How can I extract from Matlab two vector with diferrent dimension in to the same excel page without having to create different sheets
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Bernardo Pereira
am 30 Apr. 2020
Kommentiert: Bernardo Pereira
am 30 Apr. 2020
T=table(X(:),Y(:));
% X and Y have the same length
fileName='Project.xlsx';
writetable(T,fileName);
I need to extrac other 2 vector (with equal length) but with differente length from the privious ones to the same exel file~or at least to the same exel file but in a different sheet.
How can I do that?
0 Kommentare
Akzeptierte Antwort
Tommy
am 30 Apr. 2020
One option, which leaves a blank column between the two sets:
T2 = table(X2(:), Y2(:));
writetable(T2, fileName, 'Range', 'D1');
8 Kommentare
Tommy
am 30 Apr. 2020
You can do that! T and L are different tables, you are able to use any valid syntax of the function table() for either one. Do you get an error if you do try it like that? i.e.
T=table(deaths(:),rate(:),'VariableNames',{'Deaths','Rate'});
fileName='Results.xlsx';
writetable(T,fileName);
L=table(Mortality(:),life(:), 'Variablenames', {'Mortality','life'});
writetable(L,fileName,'Range','D1');
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!