필터 지우기
필터 지우기

removing equal elements from a matrix

조회 수: 1 (최근 30일)
som
som 2013년 2월 26일
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일
a=[ 1 2 3 ; 3 4 5; 6 4 7];
b=unique(a(:))'
  댓글 수: 2
Andrei Bobrov
Andrei Bobrov 2013년 2월 26일
som
som 2013년 2월 26일
Thanks a lot

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by