removing equal elements from a matrix

Hi all,
I have a matrix like "a" whose some elemnts are equal to each other. I wato to transform this matrix to a vector like "b" with non-equal elements.
e.g. a=[ 1 2 3 ; 3 4 5; 6 4 7]; >> b=[1 2 3 4 5 6 7];
How can I write this program? Thanks in advance.

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 26 de Feb. de 2013
Editada: Azzi Abdelmalek el 26 de Feb. de 2013
a=[ 1 2 3 ; 3 4 5; 6 4 7];
b=unique(a(:))'

2 comentarios

unique(a)
som
som el 26 de Feb. de 2013
Thanks a lot

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Language Fundamentals en Centro de ayuda y File Exchange.

Preguntada:

som
el 26 de Feb. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by