Borrar filtros
Borrar filtros

How do I add these files to my loop?

1 visualización (últimos 30 días)
Fatemah Ebrahim
Fatemah Ebrahim el 18 de Jun. de 2020
Respondida: Image Analyst el 18 de Jun. de 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

Respuestas (1)

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

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by