Is there easier way to assign structure data

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 }

 Accepted Answer

Adam
Adam on 13 Oct 2014
Edited: Adam on 13 Oct 2014
struct1 = struct( 'A', 1, 'B', 2, 'C', 3 );

More Answers (0)

Categories

Products

Tags

Asked:

on 13 Oct 2014

Edited:

on 13 Oct 2014

Community Treasure Hunt

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

Start Hunting!