Matlab - How to concat dataset name + i in for loop? -


i have dataset containing several arrays identified generic name , number. modify arrays independently each other in loop so:

for i=1:length(dataset)  dataset.genericname_i(row,column)=f(x) end 

do know way that?

thanks!

unless misunderstood looks dynamic field referencing.

you (using k instead of i loop counter...try avoid using either i or j purpose):

for k=1:length(dataset)     name = sprintf('genericname_%i',k);     %// note use of brackets create dynamic field    dataset.(name) =f(x);  end 

is meant?


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

c# - Retrieve google contact -

javascript - How to insert selected radio button value into table cell -