Creating Pairwise comparison Triangular Matrix using Row name, Column Name and its corresponding compared output
    4 ビュー (過去 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
      
      
 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 Center および File Exchange で Matrix Indexing についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!