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.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 26일
편집: Azzi Abdelmalek 2013년 2월 26일

0 개 추천

a=[ 1 2 3 ; 3 4 5; 6 4 7];
b=unique(a(:))'

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Language Fundamentals에 대해 자세히 알아보기

질문:

som
2013년 2월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by