Compare each row of a matrix

조회 수: 3 (최근 30일)
Ruben Sierra
Ruben Sierra 2015년 4월 23일
댓글: Star Strider 2015년 4월 24일
I would like to compare each row of the Matrix with the rest.
For example if you have the matrix:
A = [1 1 1;2 2 2;3 3 3;4 4 4}
Compare first row with the second, third, fourth. And Automatically the Programme takes the second row and do the same process(first, third, fourth), third row with first, second, fourth, and the fourth row with first, second and third.
If someone could help me I would be very greatful

채택된 답변

Star Strider
Star Strider 2015년 4월 23일
I would use the pdist function, and define your own distance metric if it is not one of those already provided.
  댓글 수: 2
Ruben Sierra
Ruben Sierra 2015년 4월 24일
Thanks for your answer.
Star Strider
Star Strider 2015년 4월 24일
My pleasure.

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

추가 답변 (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