How to create table?

조회 수: 7 (최근 30일)
Rounak Saha Niloy
Rounak Saha Niloy 2022년 6월 30일
편집: Pratyush Swain 2022년 6월 30일
I have 3 Problems named "A", "B", "C". For each three problems, I have 4 Performance Metrics- "D", "E", "F", "G". And for each performance metrics of each problem, I have 11 datas. From these, I want to create a table like this-
How do I do this?

채택된 답변

Pratyush Swain
Pratyush Swain 2022년 6월 30일
편집: Pratyush Swain 2022년 6월 30일
Hi,
One way to have this table is to assign problem name to each of its constituent problem metric.The table can take shape as follows: (I have used random values for stats)
V_table = table( ...
{'A';'A';'A';'A';'B';'B';'B';'B';'C';'C';'C';'C'}, ...
{'D';'E';'F';'G';'D';'E';'F';'G';'D';'E';'F';'G'}, ...
[0.4;0.4;70;60;4;2500;0.01;60;4;2500;0.01;60], ...
[0.4;0.4;70;60;4;2500;0.01;60;4;2500;0.01;60], ...
[0.4;0.4;70;60;4;2500;0.01;60;4;2500;0.01;60], ...
[0.4;0.4;70;60;4;2500;0.01;60;4;2500;0.01;60], ...
'VariableNames',{'Problem Name','Performance Metrics','Minimum Value','Maximum Value','Mean Value','Standard Value'})
For more information for creating table from files and various other functionalities you can refer here tables
I hope this helps.

추가 답변 (1개)

Chunru
Chunru 2022년 6월 30일
problem =["A", "A","A","A","B","B","B","B","C","C","C","C"]';
performance = ["D","E","F","G","D","E","F","G","D","E","F","G"]';
MinVal = randn(12, 1);
T = table(problem, performance, MinVal)
T = 12×3 table
problem performance MinVal _______ ___________ ________ "A" "D" -0.97409 "A" "E" 1.907 "A" "F" -0.57673 "A" "G" -0.43088 "B" "D" -2.1758 "B" "E" 2.0867 "B" "F" 1.0876 "B" "G" 0.057104 "C" "D" 0.36201 "C" "E" -0.58953 "C" "F" 0.17386 "C" "G" -0.96388

카테고리

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

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by