I'm inputting large data sets (~300 x 500) and need to act on the data creating lots of new variables. I've got syntax for adding, deleting, moving columns but can't find anything that talks about how to assign values to a column being created in the same line. There are so many columns that need to be acted on in the same way I really need loops. The closest seems to be incorporating eval, but it's not doing what I expect. As a simplified example:
summaryTable = readtable(strcat(path,'/',name,ext));
eval(strcat(summaryTable, '.Multiplied', string(i))) = eval(strcat('summaryTable.VarA', string(i))) .* eval(strcat('summaryTable.VarB', string(i)))
The eval statements work on the right, but assigning the new variable doesn't. What's the secret?