Fetch data from multi dimensional struct
Afficher commentaires plus anciens
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.
Réponses (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}
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!