How can I create a single header for two columns for a table?
7 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
回答(1 个)
Peter Perkins
2018-1-17
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactions, Camera Views, and Lighting 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!