Inserting excel files from different folders for different processing
1 回表示 (過去 30 日間)
古いコメントを表示
Hi all,
I have a question about inputting data into MATLAB for some kind of analysis. I have a large amount of excel data inside different folders. Let's suppose folders are like: wp1, wp2,... and bp1, bp2,...; and inside wp folders are excel files like t1, t2,... & similarly for bp folders we have excel files like t1, t2,...
A special kind of process according to the folder name (wp or bp) should be done on excel files. The problem is how can I import all these excel files from different folders in MATLAB considering the point that MATLAB recognizes the name of the folder (wp or bp) and doing a certain process for the excel files.
Many thanks
0 件のコメント
採用された回答
Jürgen
2013 年 12 月 2 日
Hi, your question looks similar to: http://www.mathworks.com/matlabcentral/newsreader/view_thread/274014 regards,J
2 件のコメント
Jürgen
2013 年 12 月 2 日
you do not need to know the number of folder or the number of files with the dir command all files/folders are put in "FileList"
FileList = dir('path');
FileList = FileList(~[FileList.isdir]); %remove directories
[junk, sortorder] = sort([FileList.datenum]);
FileList = FileList(sortorder); %list is now in ascending date order
numfiles = numel(FileList);
In = cell(numfiles,1);
% Processing the images in a loop
for ii = 1:numfiles
do something with FileList(ii).name
end
その他の回答 (1 件)
Image Analyst
2013 年 12 月 2 日
See code examples in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
If you need to know how to recurse into subfolders, see the file I attached below (in blue).
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!