copy data from array to table
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Marc Elmeua
am 9 Feb. 2020
Kommentiert: Marc Elmeua
am 9 Feb. 2020
Dear all,
I have an array with n number of columns and 100 rows. I would like to copy them into a table with the same dimension that has the names of the variables already written.
any ideas?
Thanks in advance!
Akzeptierte Antwort
BN
am 9 Feb. 2020
Bearbeitet: BN
am 9 Feb. 2020
Table = array2table(A);
If you want to change the variable names, so you can do this nicely, otherwise variable names stay what they are at the A
Table = array2table(A,'VariableNames',{'firstvariable','secondvariable','etc...'})
Here is an example for you:
A = rand(10,5); % here is random array with 10 rows and 5 columns
Table = array2table(A,'VariableNames',{'varname_1','varname_2','varname_3','varname_4','varname_5'}); %convert it to table and change the variable names
Best Regards
5 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!