How do you plot sequentially numbered files on one plot?
显示 更早的评论
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 个评论
S B
2017-9-6
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.
采纳的回答
更多回答(1 个)
Walter Roberson
2017-9-6
0 个投票
2 个评论
S B
2017-9-6
Walter Roberson
2017-9-6
.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?
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!