Call file names one by one from an array
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Damith
el 25 de Mzo. de 2015
Comentada: Damith
el 26 de Mzo. de 2015
Hi,
I have the "d" array (31x1 struct) which has file names.
When I do the following in the command prompt:
>> d.name
list all the names stored in d array
Is there a way to call one name at a time since I am planning to use a for loop
For example:
for i=1:length(d)
input_file=[d.name];
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148334/image.bmp)
0 comentarios
Respuesta aceptada
per isakson
el 25 de Mzo. de 2015
Editada: per isakson
el 25 de Mzo. de 2015
"one name at a time"   Replace
input_file=[d.name];
by
input_file = d(i).name;
Más respuestas (2)
Konstantinos Sofos
el 25 de Mzo. de 2015
Hi,
By d.name you call all names,instead use d(idx).name to call the required filename
for idx=1:length(d)
input_file=d(idx).name;
end
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!