How to generate horizontal titles on the table generated by array2table

조회 수: 3 (최근 30일)
Aarav Shah
Aarav Shah 2022년 1월 26일
답변: Arif Hoq 2022년 1월 26일
tableGen =
1.0000 0 0.5000 0.7500 0.8750 0.8125 0.8438 0.8594 0.8516 0.8477 0.8457 0.8447
2.0000 1.0000 0.5000 0.2500 0.1250 0.0625 0.0312 0.0156 0.0078 0.0039 0.0020 0.0010
1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000
table =
3×12 table
tableGen1 tableGen2 tableGen3 tableGen4 tableGen5 tableGen6 tableGen7 tableGen8 tableGen9 tableGen10 tableGen11 tableGen12
_________ _________ _________ _________ _________ _________ _________ _________ _________ __________ __________ __________
1 0 0.5 0.75 0.875 0.8125 0.84375 0.85938 0.85156 0.84766 0.8457 0.84473
2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625 0.0078125 0.0039062 0.0019531 0.00097656
1 2 3 4 5 6 7 8 9 10 11 12
Is there a way to position the titles on the left handed side, as if they were part of the existing matrix? That is to say, the left hand side instead of top? Thanks.

답변 (1개)

Arif Hoq
Arif Hoq 2022년 1월 26일
You can try with this:
tableGen=[1.0000 0 0.5000 0.7500 0.8750 0.8125 0.8438 0.8594 0.8516 0.8477 0.8457 0.8447
2.0000 1.0000 0.5000 0.2500 0.1250 0.0625 0.0312 0.0156 0.0078 0.0039 0.0020 0.0010
1.0000 2.0000 3.0000 4.0000 5.0000 6.0000 7.0000 8.0000 9.0000 10.0000 11.0000 12.0000
];
inv=tableGen';
LastName={'tableGen1','tableGen2','tableGen3','tableGen4','tableGen5',...
'tableGen6','tableGen7','tableGen8','tableGen9','tableGen10','tableGen11','tableGen12'};
find_table=array2table(inv,'RowNames',LastName);

카테고리

Help CenterFile Exchange에서 Numeric Types에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by