Fetch data from multi dimensional struct
显示 更早的评论
Hi,
I am new to mat lab and I am facing trouble with structs.
I want to fetch the data from a multi dimensional sturct tree.frame(1x2913 struct) and the frame has data 2913 x 5


I need to extract the field ms from the tree.frame.
Help on this is much appreciated.
回答(1 个)
Referencing the field will generate a comma separated list, which you can capture into a cell array like you would expect:
%create random data to match your data shape and type
tree=struct;for n=1:10,tree.frame(n).ms=regexprep(tempname,'[a-zA-Z\\/_]','');end
{tree.frame.ms}
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!