Hello,
How removing some elements from a long vector.
For example:
c=[1 2 3];
z=[10 9 1 4 11 2 6 3];
How removing c from z?
Tjanks in advance

 採用された回答

Stephen23
Stephen23 2022 年 8 月 9 日
編集済み: Stephen23 2022 年 8 月 9 日

0 投票

c = [1,2,3]
c = 1×3
1 2 3
z = [10,9,1,4,11,2,6,3]
z = 1×8
10 9 1 4 11 2 6 3
x = setdiff(z,c,'stable')
x = 1×5
10 9 4 11 6
or
z(ismember(z,c)) = []
z = 1×5
10 9 4 11 6

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

製品

リリース

R2022a

質問済み:

2022 年 8 月 9 日

コメント済み:

2022 年 8 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by