Call file names one by one from an array
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
per isakson
2015-3-25
编辑:per isakson
2015-3-25
"one name at a time"   Replace
input_file=[d.name];
by
input_file = d(i).name;
更多回答(2 个)
Konstantinos Sofos
2015-3-25
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
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!