Creating Pairwise comparison Triangular Matrix using Row name, Column Name and its corresponding compared output

조회 수: 1 (최근 30일)
I am trying to create a matrix using the results produced by doing a pairwise comparison. As an example, my FOR loop generates the Row Name, Column Name and the comparison between these two as an output (The output comes after the series of calculations and not a difference or something).
For example, my For loop every time generates the following variables:
E1
E2
0.6154
E1
E3
0.5824
.
.
.
.
E52
E51
0.7014
So I want to have a triangular matrix which looks like as below
E1 E2 E3 E52
E1 0 0.6154 0.5824
E2
.
.
.
E52 . .
I don't see any functions to my knowledge does this part, can anyone help me here how to achieve this? Thanks
  댓글 수: 1
Stephen23
Stephen23 2018년 1월 21일
편집: Stephen23 2018년 1월 21일
"Creating Pairwise comparison Triangular Matrix using Row name, Column Name ..."
MATLAB is not Excel and it does not use column or row names. MATLAB uses indexing. Indexing is explained quite clearly in the introductory tutorials, which are highly recommended for all beginners:
Simply preallocate the output array and then use indexing in the loop.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by