Borrar filtros
Borrar filtros

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

32 visualizaciones (últimos 30 días)
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..

Respuesta aceptada

Thomas
Thomas el 4 de Jun. de 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

Más respuestas (0)

Categorías

Más información sobre Search Path 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