How to add columns with fixed values to their exact position in the table
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Akashdeep Kaur
el 18 de Jul. de 2022
Comentada: Abderrahim. B
el 18 de Jul. de 2022
Hello, I have a table with 16 columns. Some columns have variable value and some have fixed value.
I fixed their values like:
simtable.datacenters(:)="Cloud_1";
Now, This column is at no. 4 in my table. but, when printing output it gets printed at last.
I also want to generate its excel sheet but the columns with fixed values are not added to excel sheet.
Thank you.
0 comentarios
Respuesta aceptada
Abderrahim. B
el 18 de Jul. de 2022
Editada: Abderrahim. B
el 18 de Jul. de 2022
Hi,
Use addvars instead of dot notation to add columns to your table.
Demo:
load patients
T = table(Age,Gender,Smoker) ;
% add a new column to T table before Age
T = addvars(T,LastName,'Before','Age')
Hope this helps
10 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!