Adding a column to table
1,803 views (last 30 days)
Show older comments
Hey everyone.
I have created my own csv-file. When I use readable to load the table, I get a 8x10 table. I want to expand the table to a 8x11 table where the 11th column should have the values from a function I have created. Can anyone help me with this(I have to give the 11th column a title as well)?
0 Comments
Accepted Answer
Walter Roberson
on 20 Nov 2015
It appears you need to concatenate tables; see for example http://www.mathworks.com/matlabcentral/answers/233921-how-to-add-a-column-of-today-s-date-to-a-table
0 Comments
More Answers (3)
Sean de Wolski
on 20 Nov 2015
T.EleventhColumn = rand(8,1);
Where 'EleventhColumn' is the name you want for the variable.
2 Comments
thang ngo
on 24 Jul 2020
This helps to pass a name as parameter:
name = 'new_column'
T.(name) = rand(8,1);
0 Comments
Ehab Abdelkarim
on 3 Aug 2018
you may want to check the following link https://de.mathworks.com/help/matlab/matlab_prog/add-and-delete-table-variables.html
0 Comments
See Also
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!