Effacer les filtres
Effacer les filtres

Subplot of a matrix 2x361x10

1 vue (au cours des 30 derniers jours)
Saverio Loiacono
Saverio Loiacono le 6 Mai 2024
Modifié(e) : Voss le 6 Mai 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.

Réponses (1)

Voss
Voss le 6 Mai 2024
Modifié(e) : Voss le 6 Mai 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