Compare each row of a matrix

1 回表示 (過去 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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by