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 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ivan Vidovic
am 2 Mai 2019
Kommentiert: Ivan Vidovic
am 2 Mai 2019
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
0 Kommentare
Akzeptierte Antwort
Bob Thompson
am 2 Mai 2019
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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!