How can I create a single header for two columns for a table?

7 views (last 30 days)
Hallo!!I have created this table:
using the command:
LowerBound=[-0.2213;-0.2047;-0.1860;-0.1804;-0.0890;-0.0597];
UpperBound=[-0.2828;-0.2673;-0.2475;-0.2416;-0.1531 ;-0.1173];
AlpaParameter=[0.25;0.24;0.22;0.21;0.12;0.09];
IQR={'Fixed';'IQR=250';'IQR=500';'IQR=600';'IQR=750';'IQR=1000'};
T = table(AlpaParameter,LowerBound,UpperBound,'RowNames',IQR)
uitable('Data',T{:,:},'ColumnName',T.Properties.VariableNames,'RowName',T.Properties.RowNames,'Units', 'Normalized', 'Position',[0, 0, 1, 1]);
How can I create a common header for both the two last columns like this:
thanks!

Answers (1)

Peter Perkins
Peter Perkins on 17 Jan 2018
One possibility is
ConfidenceInterval = [LowerBound,UpperBound];
T = table(AlpaParameter,ConfidenceInterval,'RowNames',IQR)
Notice that because ConfidenceInterval is an Nx2 numeric matrix, you lose the names LowerBound and UpperBound. You could also make ConfidenceInterval a table, as
ConfidenceInterval = table(LowerBound,UpperBound);
and then nest that inside t. Hard to know which would be more useful for you.

Categories

Find more on Interactions, Camera Views, and Lighting 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!