Data read in

6 vues (au cours des 30 derniers jours)
Ieva
Ieva le 2 Mar 2012
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

Réponses (2)

Jan
Jan le 2 Mar 2012
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 le 2 Mar 2012
Thank you! Seems that works.

Catégories

En savoir plus sur Workspace Variables and MAT Files dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by