How to Create a Column Vector of a Field of a Struct?
17 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rightia Rollmann
am 1 Mär. 2017
Bearbeitet: Stephen23
am 1 Mär. 2017
How to create column vectors out of B (i.e., D = [10;20;30]) and C (i.e., E = [100;200;300])?
A(1).B = 10;
A(2).B = 20;
A(3).B = 30;
A(1).C = 100;
A(2).C = 200;
A(3).C = 300;
0 Kommentare
Akzeptierte Antwort
Jan
am 1 Mär. 2017
Bearbeitet: Jan
am 1 Mär. 2017
D = [A.B];
E = [A.C];
This is the short for of:
[A(:).B]
which has the advantage, that the intention is more obvious during reading.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures 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!