Consider the following table in Matlab
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T = table(Age,Height,Weight,BloodPressure,'RowNames',LastName)
If I try to create uitable
as follows, I receive error
uit = uitable('Data', T)
Although the following works: (Except: BloodPressure Variable should occupy two columns)
TVN = T.Properties.VariableNames;
TRN = T.Properties.RowNames;
TData = T{:,:};
uit = uitable('Data', TData, 'ColumnName', TVN, 'RowName', TRN);
I want to know, Is there a shorter or direct way of doing this?
I am using R2014a.
Thanks