How to iterate through a struct ?
    8 次查看(过去 30 天)
  
       显示 更早的评论
    
How can i iterate through a struct in matlab ? Here is my code that does not work
im_filenames = dir('./JAAD_frames/video_0001/');
for name,foldername in im_filenames:
    print(name, foldername)
0 个评论
回答(2 个)
  Image Analyst
      
      
 2018-11-9
        Try this:
filesStructure = dir('./JAAD_frames/video_0001/*.*')
allFileNames = {filesStructure(:).name}
for k = 1 : length(allFileNames)
  fprintf('allFileNames{%d} = %s\n', k, allFileNames{k});
end
0 个评论
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


