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 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