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.
댓글 수: 2
Theodore Wilkening
2020년 3월 13일
this works best.
Yifei
2022년 11월 26일
The most convenient approach.
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!