Using Strcat to create dynamic variable names

前端 未结 3 1840
甜味超标
甜味超标 2020-12-21 15:10

I have a process which is repeated on a set of data stored in separate folders. Each time a certain folders data is processed I need new variable names as I need to results

3条回答
  •  时光说笑
    2020-12-21 15:43

    The MATLAB function genvarname does what you want. In your case it would look something like:

    eval(genvarname('Set_', who)) = zeros(dim, number);
    

    However, I would follow the recommendations of previous answers and use a cell or struct to store the results.

提交回复
热议问题