How to add columns with fixed values to their exact position in the table
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Akashdeep Kaur
il 18 Lug 2022
Commentato: Abderrahim. B
il 18 Lug 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 Commenti
Risposta accettata
Abderrahim. B
il 18 Lug 2022
Modificato: Abderrahim. B
il 18 Lug 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Spreadsheets in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!