several plot - subplot for-loop

I have several plot in a for loop.
I want to see them on one side but I can't figure out what values ​​I have to put in subplot () in a for loop
Files=dir('*.csv')
for k=1:length(Files)
filename=Files(k).name
filename='dataset_001.csv'
figure
yyaxis left
plot(p,ODsatpercent,'bo--');
yyaxis right
plot(p,Tclean.CTDTMP,'ro--');
legend('%Od','t');
end

Risposte (2)

Jan
Jan il 10 Mag 2021
Maybe:
...
subplot(1, length(Files), k);
yyaxis left
plot(p,ODsatpercent,'bo--');
yyaxis right
plot(p,Tclean.CTDTMP,'ro--');
legend('%Od','t');

2 Commenti

After your comment: Then:
subplot(12, 13, k);
thank you!

Accedi per commentare.

GIOVANNA GUADAGNIN
GIOVANNA GUADAGNIN il 10 Mag 2021

0 voti

thanks but this 'for' is for 122 different csvs which lead to a graph. I would like to make a matrix with size rows and columns = the square root of 122 to see all the graphs together

Categorie

Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by