How do I add these files to my loop?
1 回表示 (過去 30 日間)
古いコメントを表示
I have multiple files and I only want my Excel files added to the directory.
myDir = uigetdir('path'); %gets directory
myFiles = dir(fullfile(myDir));
M(length(myFiles),s)=zeros; %gets all wav files in struct
for k = 1:length(myFiles)
baseFileName = myFiles(k).name;
fullFileName = fullfile(myDir, baseFileName);
A = readmatrix(fullFileName,'Whitespace',' []');
end
0 件のコメント
回答 (1 件)
Image Analyst
2020 年 6 月 18 日
Try this:
filePattern = fullfile(myDir, '*.xls*');
myFiles = dir(filePattern);
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!