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

9 ビュー (過去 30 日間)
Panos Ale
Panos Ale 2018 年 1 月 17 日
回答済み: Peter Perkins 2018 年 1 月 17 日
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!

回答 (1 件)

Peter Perkins
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.

カテゴリ

Help Center および File ExchangeInteractions, Camera Views, and Lighting についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by