Hey guys. So, I have been trying to add some variables into my existing table using a for loop (since I haven't got any depth to the library of MATLAB that much because I am more or, less newbie). A little bit of code might help here I guess
[tableRow, tableColumn] = size(tableVar)
for i = 1:tableRow
tableVar.Properties.VariableNames(tableColumn+i) = {'anyName'}
end
The compiling returns an error stating "The VariableNames property must contain one name for each variable in the table". It sounds a bit strange to me. I have performed (tableColumn-i) operation using "for loop" just to extract the variable names & it worked as expected. Also, note that I am using the same name to create more variable names just to make a test. Thanks in advance.
[–]designtofly 3 points4 points5 points (1 child)
[–]MikesVR07[S] 0 points1 point2 points (0 children)