フィルターのクリア

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 Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by