I want to add elements in struct without looping like I have done below:
test_struct = struct ('item1', {} , 'item2' , {} ) ;
for k = 1 : 10
test_struct(k).item1 = 1:10 ;
test_struct(k).item2 = 2* (1:10) ;
end
Is there a way to add elements like adding elements in List in C#. I want a dynamic struct array because I do not know the how many elements, I will have to add in it.