Azzera filtri
Azzera filtri

Subplot of a matrix 2x361x10

1 visualizzazione (ultimi 30 giorni)
Saverio Loiacono
Saverio Loiacono il 6 Mag 2024
Modificato: Voss il 6 Mag 2024
Hi, I need to know how I can make a subplot. With the FEM analysis on an asynchronous machine, I get a matrix of the magnetic field taken after simulation in matlab, which is 2x361x10. Where 361 are the rotor positions, and 10 are the time instants for which I calculated the 361 rotor positions, each time. I would like to know how to make 10 subplots of B as a function of the instants of time for which I calculated the matrix.

Risposte (1)

Voss
Voss il 6 Mag 2024
Modificato: Voss il 6 Mag 2024
% random 2x361x10 data:
data = rand(2,361,10);
data(1,:,:) = data(1,:,:)*2;
figure
[~,n,p] = size(data);
for ii = 1:p
subplot(5,2,ii)
plot(data(:,:,ii).') % some plot of data(:,:,ii)
title(sprintf('ii = %d',ii))
xlim([1 n])
end

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by