Open multiple files in different sub-folders with same starting file name
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have a multiple files I need to read in 39 sub-folders in Home directory. For example:
Home\folder1\Output_1 Home\folder2\Output_2 .. Home\folder39\Output_39
What is the MATLAB function I can use to open all the sub-folders so that I can use importfile function to read all Output files from 1 to 39.
Thanks in advance for the help.
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2014 年 5 月 22 日
編集済み: Azzi Abdelmalek
2014 年 5 月 22 日
for k=1:39
f=sprintf('Home\\folder%d\\output_%d',k,k)
% read f
end
2 件のコメント
Image Analyst
2014 年 5 月 22 日
Notice how you use a single backslash and Azzi used a double backslash? It makes a difference. But why not just use a single forward slash instead? It works just fine in Windows - Windows does not require backslashes.
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!