How to create pairwise comparison matrix for row matrix?

hai, example matrix :
a=[3 3 2 3 5 3 5 3 4];
How to create a pairwise comparison matrix for the above row matrix?
Thanks in advance

댓글 수: 2

Example of desired output?
a=[1 2 3]; % 1 2 3 % 1 1/1 1/2 1/3 % 2 2/1 1/1 2/3 % 3 3/1 3/2 1/1 pairwise=[1/1 1/2 1/3; 2/1 1/1 2/3; 3/1 3/2 1/1];

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

답변 (1개)

Bruno Luong
Bruno Luong 2018년 10월 31일
편집: Bruno Luong 2018년 10월 31일
Replace == with whatever comparison operator that is suitable for you
C = a == a.'
Edit, seem like you want (this is called division, not comparison)
C = a.' ./ a

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2018년 10월 31일

댓글:

2018년 11월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by