dimanche 6 septembre 2015

Check existence of 'filename' in a chosen folder

I use

dir = uigetdir;

to ask the user for a foldername. In the next step, I want to make an if-else-statement, that checks if there is a file with a specific file name in that folder. A little bit like the following (not working) code:

if exist(dir/'filename','file')==true
  load([dir '/filename.mat']);
end

Aucun commentaire:

Enregistrer un commentaire