How can I write a program that plots multiple, numbered, input files (in succession) on a single graph?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am somewhat new to MATLAB and would like to run a program that plots 7 data files on the same graph. I named my data files input1.dat, input2.dat, input3.dat, ..., input7.dat thinking I might be able to use a For Loop and the "hold on" command. Currently, I can get the graph I want by running my program 7 times (changing the input file name each time) and plotting all of my plots in the same figure (which is figure(1)). But I haven't figured out how I can write the program to do everything I want in one run. Can anyone help me?
0 Kommentare
Antworten (1)
Walter Roberson
am 1 Jan. 2016
for K = 1 : 7
thisfile = sprintf('input%d.dat', K);
at this point read from file thisfile
plot(...)
hold on
end
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!