distinct values for a matrix

10 次查看(过去 30 天)
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)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sparse Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by