read-open many files
1 次查看(过去 30 天)
显示 更早的评论
Hi all!
I have 200 files with name day_0012014 until day_2002014. Each file has 3 columns. I want to plot first and third columns. What can i do?
Thanks...
0 个评论
回答(1 个)
Azzi Abdelmalek
2015-7-10
编辑:Azzi Abdelmalek
2015-7-10
You didn't specify the type of files (text file or Excell or ...). Suppose they are text files
for k=1:200
FileName=sprintf('day_%03g2014.txt',k)
data{k}=dlmread(Filename)
end
Now you can access to each matrix
figure
hold on
for k=1:numel(data)
c1=data{k}(:,1)
c3=data{k}(:,3)
plot(c1,c3)
end
hold off
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!