Effacer les filtres
Effacer les filtres

list all the files of certain type in directory and put them in a variable

32 vues (au cours des 30 derniers jours)
Walter
Walter le 4 Juin 2012
How do I put all files of certain type in a directory and put them in variable
eg. if my directory has 2 images new.jpg and tell.jpg
I want in matlab
a(1)=new.jpg a(2)=tell.jpg
automatically without me having to hardcode it in..

Réponse acceptée

Thomas
Thomas le 4 Juin 2012
I guess you will have more processing to do after getting all the file names in matlab. Here is a wonderful example on how to process a sequence of file sin MATLAB
else if you just want the names of jpg files in a variable
try
a=dir('*.jpg')
a(1,1).name
a(2,1).name

Plus de réponses (0)

Catégories

En savoir plus sur Search Path dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by