Call file names one by one from an array
Afficher commentaires plus anciens
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

Réponse acceptée
Plus de réponses (2)
the cyclist
le 25 Mar 2015
d(1).name
will the name field of the first struct.
1 commentaire
Damith
le 25 Mar 2015
Konstantinos Sofos
le 25 Mar 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
1 commentaire
Damith
le 26 Mar 2015
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!