distinct values for a matrix

7 ビュー (過去 30 日間)
kash
kash 2012 年 1 月 4 日
I have a matrix of 10x10..i have to find distinct values,,please help..those distinct values must also be a in matrix form..

採用された回答

Walter Roberson
Walter Roberson 2012 年 1 月 4 日
unique() can be used to find distinct values. With the three-output form of unique() you can create a vector of indices into the unique values.
  3 件のコメント
Walter Roberson
Walter Roberson 2012 年 1 月 4 日
The number of unique values could vary from column to column, so the results cannot be placed in to a numeric matrix.
arrayfun(@(IDX) unique(Matrix(:,IDX)), 1:size(Matrix,2), 'Uniform', 0)
kash
kash 2012 年 1 月 4 日
Thank u walter

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by