How do you plot sequentially numbered files on one plot?
Ältere Kommentare anzeigen
I am new to MATLAB and have created ascii folders with 30 .asc files in each that I would like to plot on one graph. I have tried to figure out how to do this, but have a limited understanding of MATLAB. I know I need to include the matrix size (200:1), but this is actually 2 columns with x,y values in it.
So far all I have is:
Files = ('sample1_1_*.asc');
clf,figure,hold on;
for k = 1:30
plot(Files(k,:))
end
But this gives an error of 'Index exceeds matrix dimensions.'
Any help would be much appreciated or if you could direct me to a relevant post that would be fantastic!
3 Kommentare
S B
am 6 Sep. 2017
It's caused because the file name is just a 1-line string in matlab. "Files" does not store the 30 asc file names correctly (hence you'll get an index exceed error). I think I can give you a function that'll work, but could you copy and paste just the first 5 data points for one asc file that you want to plot? Just so I can see if matlab has the right file reader.
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 6 Sep. 2017
0 Stimmen
2 Kommentare
S B
am 6 Sep. 2017
Walter Roberson
am 6 Sep. 2017
.asc is not a standardized file format. We would need to know the data format in the files. Is there a header? How many columns? What is the delimiter between the columns?
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!