distinct values for a matrix

10 visualizaciones (últimos 30 días)
kash
kash el 4 de En. de 2012
I have a matrix of 10x10..i have to find distinct values,,please help..those distinct values must also be a in matrix form..

Respuesta aceptada

Walter Roberson
Walter Roberson el 4 de En. de 2012
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 comentarios
Walter Roberson
Walter Roberson el 4 de En. de 2012
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 el 4 de En. de 2012
Thank u walter

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Sparse Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by