Retrieving data from a structure
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Inti Vanmechelen
am 5 Nov. 2016
Kommentiert: Inti Vanmechelen
am 5 Nov. 2016
Hi,
I have a 1x36 structure with 34 fields called Dat_store. The first field contains 36 times a 1x4 vector with information on com: K4_com. Now I'd like to extract this CoM data and create a 36x4 matrix one value of the 1x4 vector in each column of the matrix. I tried
K4_COM = [Dat_store_12().K4_com];
But that gives me a 1x144 vector, which is not what I want.
Does anybody know what the correct command should be?
Thanks
0 Kommentare
Akzeptierte Antwort
Guillaume
am 5 Nov. 2016
K4_COM = vertcat(Dat_store_12.K4_com)
is the correct syntax (yours was equivalent to horzcat(Dat_store_12.K4_com) hence why they were all concatenated in a row).
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Use COM Objects in MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!