Call file names one by one from an array

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

 채택된 답변

per isakson
per isakson 2015년 3월 25일
편집: per isakson 2015년 3월 25일

0 개 추천

"one name at a time" &nbsp Replace
input_file=[d.name];
by
input_file = d(i).name;

추가 답변 (2개)

the cyclist
the cyclist 2015년 3월 25일

0 개 추천

d(1).name
will the name field of the first struct.
Konstantinos Sofos
Konstantinos Sofos 2015년 3월 25일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2015년 3월 25일

댓글:

2015년 3월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by