That is my current code:
%%Struct Problem
for k=1:5 struct.i(k).m=rand; struct.i(k).n=rand; struct.i(k).o=rand; struct.i(k).p=rand; struct.i(k).q=rand;end
And I want to automate the steps in a way like this:
for k=1:5 for a=['m','n','o','p','q'] struct.i(k).a=rand; endend
How can I automatically create and edit fields with a for loop?
Best Answer