필터 지우기
필터 지우기

Subplot of a matrix 2x361x10

조회 수: 1 (최근 30일)
Saverio Loiacono
Saverio Loiacono 2024년 5월 6일
편집: Voss 2024년 5월 6일
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.

답변 (1개)

Voss
Voss 2024년 5월 6일
편집: Voss 2024년 5월 6일
% 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

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by