Filter löschen
Filter löschen

How do I add these files to my loop?

1 Ansicht (letzte 30 Tage)
Fatemah Ebrahim
Fatemah Ebrahim am 18 Jun. 2020
Beantwortet: Image Analyst am 18 Jun. 2020
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

Antworten (1)

Image Analyst
Image Analyst am 18 Jun. 2020
Try this:
filePattern = fullfile(myDir, '*.xls*');
myFiles = dir(filePattern);

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by