how to import data from multiple folders in matlab?
5 ビュー (過去 30 日間)
古いコメントを表示
I have my data in multiple folders. let say i have a folder containing 3 subfolders at the moment that look like this
/folder/Re0001/vitesse
/folder/Re0002/vitesse
/folder/Re0003/vitesse
i want to import the vitesse file in to cell array. this is the code that i am using at the moment
*numfiles=3;
mydata=cell(1,numfiles);
for i=1:numfiles
mydata{i}=uiimport;
end*
##really appreciate if u can help me. I am stuck with this for almost 3 days. thanks
0 件のコメント
回答 (1 件)
Muthu Annamalai
2013 年 7 月 1 日
I don't understand your question. You seem to already have a working solution.
filenames = {'path/1/fil1', ... }
numfiles= length(filenames);
mydata=cell(1,numfiles);
for i=1:numfiles
mydata{i}=load( filename{numfiles} );
end
If you want to access filenames dynamically you can use the dir() command.
q = dir('./')
filenames = {q.name}
You don't have a choice except for specifying the files to look for with load. Its a simple task to do.
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!