How to write this line of code to create a Matlab table?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Leon
am 5 Dez. 2020
Kommentiert: Leon
am 5 Dez. 2020
I have unknown number of column variables in cell array:
Var{1} = [ 1; 2; 3; 4; 7];
Var{2} = [33; 10; 46; 7; 2];
...
If I knew how many variables I have, I would be able to manually form my table by:
T1 = table(Var{1}, Var{2}, ...);
The problem is that I do not know how many variables each time my program will generate. In this case, how could I write the code to create the table?
I tried the below, but it does not work:
T1 = table(Var);
Many thanks.
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 5 Dez. 2020
cell2table and probably provide VariableNames parameter
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Performance and Memory 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!