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

1 vue (au cours des 30 derniers jours)
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 commentaire
Stephen23
Stephen23 le 21 Jan 2018
Modifié(e) : Stephen23 le 21 Jan 2018
"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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by