How do I add a column to table?
Mostra commenti meno recenti
I have created a CSV file. When I use the "readable" function to load the table, I get an 8x10 table. I want to expand the table to an 8x11 table, where the 11th column should have the values from a function I have created. How do I do this?
Risposta accettata
Più risposte (3)
Sean de Wolski
il 20 Nov 2015
T.EleventhColumn = rand(8,1);
Where 'EleventhColumn' is the name you want for the variable.
2 Commenti
Theodore Wilkening
il 13 Mar 2020
this works best.
Yifei
il 26 Nov 2022
The most convenient approach.
thang ngo
il 24 Lug 2020
14 voti
This helps to pass a name as parameter:
name = 'new_column'
T.(name) = rand(8,1);
Ehab Abdelkarim
il 3 Ago 2018
2 voti
you may want to check the following link https://de.mathworks.com/help/matlab/matlab_prog/add-and-delete-table-variables.html
Categorie
Scopri di più su Tables in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!