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'};
John Michell answered .
2025-11-20
>> patients2 = patients(:,order)