How do I add a column to table?
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (3)
Sean de Wolski
el 20 de Nov. de 2015
T.EleventhColumn = rand(8,1);
Where 'EleventhColumn' is the name you want for the variable.
2 comentarios
Theodore Wilkening
el 13 de Mzo. de 2020
this works best.
Yifei
el 26 de Nov. de 2022
The most convenient approach.
thang ngo
el 24 de Jul. de 2020
14 votos
This helps to pass a name as parameter:
name = 'new_column'
T.(name) = rand(8,1);
Ehab Abdelkarim
el 3 de Ag. de 2018
2 votos
you may want to check the following link https://de.mathworks.com/help/matlab/matlab_prog/add-and-delete-table-variables.html
Categorías
Más información sobre Tables en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!