Data read in

Hi,
I have quite many files starting named like data_52348.csv where the number is just random 5 digits. I would like to read in all of those files creating matlab files.
Is there a quick way how to do that: saying matlab to read in all csv files that starts with "data"?
Thanks,
Ieva

回答(2 个)

Jan
Jan 2012-3-2
List = dir(fullfile(PathName, 'data_*.csv'));
for iList = 1:length(List)
data = csvread(fullfile(PathName, data(iList).name));
...
end
Now you have to insert at the "..." what you want to do with the data.
Ieva
Ieva 2012-3-2

0 个投票

Thank you! Seems that works.

类别

帮助中心File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息

提问:

2012-3-2

Community Treasure Hunt

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

Start Hunting!

Translated by