structElement = struct('a1','', 'a2', '', 'a3', '', 'a4', '');s1 = repmat(structElement, [1,1]);
The above code gives a 1×1 struct
s2 = repmat(structElement, [2,1]);
The above code results in a 2×1 struct
If I do s2(1) it returns a structIf I do s1(1) it returns a1.
How can I create s1, such that s1(1) will give me back a struct. Basically I want to create an array of single struct.
Best Answer