Naming tables inside a for loop
13 views (last 30 days)
Show older comments
I want to change names of tables inside a for loop. Each iteration inside the for loop represent one table.
N=2;
for ii = 1:N
if ii = 1
jj = 'Attendance'
else if ii = 2
jj = 'Absence'
end
Table_'Attendance' = table(variables);
Table_'Absence' = table(variables)
end
end
I want to generate a seperate table at each iteration. I generate same variables at each iteration with different data. That's why I want to put them in tables with different names.
For example, here I mentioned that I want to have two tables and I want to name them "Table_Attendance" and "Table_Absence", respectively. Is there a way to do this?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!