How can I delete two or more elements in a vector?

For example,
A = [1 1 2 3 10 7 10 1 5 3]
two or more elements in A is 1, 3, 10.
delet two or more elements in A
-> A = [2 5 7]
How can I edit it?

 採用された回答

Stephen23
Stephen23 2020 年 1 月 11 日

1 投票

>> A = [1,1,2,3,10,7,10,1,5,3];
>> U = unique(A);
>> Z = U(histc(A,U)==1)
Z =
2 5 7

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeEntering Commands についてさらに検索

タグ

質問済み:

Han
2020 年 1 月 11 日

回答済み:

2020 年 1 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by