How do I add a column to table?
显示 更早的评论
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?
采纳的回答
更多回答(3 个)
Sean de Wolski
2015-11-20
T.EleventhColumn = rand(8,1);
Where 'EleventhColumn' is the name you want for the variable.
thang ngo
2020-7-24
14 个投票
This helps to pass a name as parameter:
name = 'new_column'
T.(name) = rand(8,1);
Ehab Abdelkarim
2018-8-3
2 个投票
you may want to check the following link https://de.mathworks.com/help/matlab/matlab_prog/add-and-delete-table-variables.html
类别
在 帮助中心 和 File Exchange 中查找有关 Tables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!