Printing table using fprintf
Show older comments
I have the following code; my problem is that in for loop i want to give different names Ti(for i=3 )to tables . For this i try to use fprintf but it doesn't work. Any ideas?
clc
clear
job={'J1';'J2';'J3';'J4'};
A=[4;10;7;9];
B=[8;13;6;11];
Sum=A+B;
u1=table(job,A,B,Sum)
u2=sortrows(u1,4,'descend');
t=removevars(u2,{'Sum'})
t1=t(1,:)
for i=1:3
Ti=[t(i+1,:);t1]
end
with this code, i got all 3 tables with name Ti.
Accepted Answer
More Answers (1)
KSSV
on 21 Apr 2020
0 votes
Why you want to use fprintf for table? Read about writetable.
1 Comment
Sukhmandeep Kaur
on 21 Apr 2020
Categories
Find more on Logical 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!