I want program a struct in Matlab for saving some parameters.
The struct's name has to change every iteration in a loop, thus in each iteration I make a new struct. Therefore I want something like this:
index={'01','02','03'}; letter={'aa','bb','cc'}; names={'Peter','John','Michael'}; for(i=1:numel(index)){ ...... strcat(str, index{i}, letter{i})(i).name = names{i}; } Then, when the loop has finished I have 3 structs with the next names:
- str01aa{ name = 'Peter' } - str02bb{ name = 'John' } - str03cc{ name = 'Michael' } My problem is that the strcat function with the bracket (i) is not good defined, and the structs are not created.
I hope you can help me.
Thanks.
evalcommand , it is not recommended by many but I can't say anything else unless I look at the exact problem.