extracting field name and values from a struct.
显示 更早的评论
Hi all,
I have files produced by a piece of research equipment and each file comes up as 1x1 struct with 65 fields. I am interested in getting the field name and corresponding values from only six of these, each field is named and not numbered.
Is there a way of getting Matlab to provide just the filenames and values of the six I am after?
Thanks!
MJ
回答(2 个)
madhan ravi
2018-11-2
0 个投票
fn=fieldnames(out);
for jj=1:size(fieldnames(YOUR_STRUCT),1)
features1(1,jj)=YOUR_STRUCT.(fn{jj});
end
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!