How to table the data

3 ビュー (過去 30 日間)
C PRASAD
C PRASAD 2022 年 7 月 2 日
回答済み: Simon Chan 2022 年 7 月 2 日
I have the data of 5*3 size and I wolud like to name it.
A=[1 2 3
4 5 6
8 9 7
1 4 5
1 0 1]
Now there are five rows and they need to be named as row1,row2,row3,row4,row5 and columns with Col1,Col2 and Col3.

採用された回答

Simon Chan
Simon Chan 2022 年 7 月 2 日
Use function array2table
A=[1 2 3
4 5 6
8 9 7
1 4 5
1 0 1];
T=array2table(A,'RowNames',compose('row%d',1:5),'VariableNames',compose('Col%d',1:3))
T = 5×3 table
Col1 Col2 Col3 ____ ____ ____ row1 1 2 3 row2 4 5 6 row3 8 9 7 row4 1 4 5 row5 1 0 1

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by