フィルターのクリア

How can I plot a figure with 5 subplots and save it and then move to the next figure containing 5 subplots and save it under an other name?

11 ビュー (過去 30 日間)
Hy, I have a dataset of 100 columns (each columns represents one channel) 150000 rows.
Now I want to create 20 figures and each figure should show the data of 5 channels in subplots.
For example:
for i=1:5
h(i) = subplot(5,1,i);
plot(t,Ch0_99_OS1(:,i));
title(NewName(i));
ylabel('intensity [a. u.]');
xlabel('time [sec]');
ylim ([-1200 27000]);
end
Now I want to save the file as Ch1_5.png and start with the next figure containing the data from channel 6-10.
How can i do this?
Thanks

採用された回答

Bob Thompson
Bob Thompson 2019 年 5 月 2 日
You can assign a figure number with the figure command.
You can save a figure with the savefig command.
Just put them both, or the savefig, into a for loop and you should be good.
for f = 1:20;
for i=1:5
h(i) = subplot(5,1,i);
plot(t,Ch0_99_OS1(:,i+(j-1)*5));
title(NewName(i));
ylabel('intensity [a. u.]');
xlabel('time [sec]');
ylim ([-1200 27000]);
end
savefig(['myfigure',num2str(f),'.png']);
end

その他の回答 (0 件)

カテゴリ

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