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 Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by