How do you order table columns based on a vector with their names?
Show older comments
I have a table, "patients", with 5 columns. I would like these columns to follow the pattern determined by the cell, "order".
How could I do this?
Reproduction steps:
>> load patients
>> patients = table(Age,Gender,Height,Weight,Smoker,...
'RowNames',LastName);
>> order = {'Gender', 'Gender', 'Age', 'Gender', 'Smoker',...
'Smoker', 'Weight', 'Height', 'Weight'};
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!