Filter löschen
Filter löschen

Get all files under a folder

19 Ansichten (letzte 30 Tage)
Ron
Ron am 13 Okt. 2022
Kommentiert: Ron am 13 Okt. 2022
Hello guys,
Im trying to get access to all files under folder that i have with matlab app designer. ( only files, excel files , .m , .mlapp .. etc , with out folders)
I saw in some other answers that i can use :
folderPath=uigetdir(pwd,'Select a folder');
files=dir(fullfile(folderPath,'*.mlap'));
and then i have struct files that i can get access to the file.name and file.name , files.folder ...etc
But it finds only the mlapp files , if I do like this
folderPath=uigetdir(pwd,'Select a folder');
files=dir(fullfile(folderPath, '*' );
it finds also the folders but that's not what i want
Need help to add only excel and another files :)

Akzeptierte Antwort

Stephen23
Stephen23 am 13 Okt. 2022
Bearbeitet: Stephen23 am 13 Okt. 2022
Just filter out the folders afterwards:
P = uigetdir(pwd,'Select a folder');
S = dir(fullfile(P,'*'));
S([S.isdir]) = [] % remove folders
  1 Kommentar
Ron
Ron am 13 Okt. 2022
Thank you very much !
Working perfect

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by