Is there easier way to assign structure data

2 Ansichten (letzte 30 Tage)
xianjie Zhou
xianjie Zhou am 13 Okt. 2014
Bearbeitet: Adam am 13 Okt. 2014
I feel there was a way to assign structure data without repeatedly refer the parents' name. For example: A structure: Struct1.A Struct1.B Struct1.C
Is there a way to assign value like following then we don't need to type struct1 repeatedly.
struct1 { .A=1 .B=2 .C=3 }

Akzeptierte Antwort

Adam
Adam am 13 Okt. 2014
Bearbeitet: Adam am 13 Okt. 2014
struct1 = struct( 'A', 1, 'B', 2, 'C', 3 );

Weitere Antworten (0)

Kategorien

Mehr zu Structures finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by