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

조회 수: 7 (최근 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 CenterFile 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!

Translated by