Fetch data from multi dimensional struct
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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.
0 Commenti
Risposte (1)
Rik
il 17 Mag 2021
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}
0 Commenti
Vedere anche
Categorie
Scopri di più su Structures in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!