How to store structure data into an array in loop?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a structure with many fields of different length.I want to store this structure data into an array in a loop.How to solve this issue.
0 Kommentare
Antworten (1)
Matt J
am 28 Mai 2013
As in the following example
>> s.a=1; s.b=[2 3]; %A struct
a: 1
b: [2 3]
>> C=struct2cell(s); [C{:}]
ans =
1 2 3
2 Kommentare
Loretta Laughrey
am 21 Jun. 2018
Bearbeitet: Loretta Laughrey
am 21 Jun. 2018
What if I want an array of structures so that:
s(1) = struct(1,[2,3])
s(2) = struct(4,[5,6])
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!