Printing table using fprintf
Afficher commentaires plus anciens
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.
Réponse acceptée
Plus de réponses (1)
KSSV
le 21 Avr 2020
0 votes
Why you want to use fprintf for table? Read about writetable.
1 commentaire
Sukhmandeep Kaur
le 21 Avr 2020
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!