setdiff with reptitions ?

18 ビュー (過去 30 日間)
daniel zayed
daniel zayed 2018 年 11 月 27 日
コメント済み: Star Strider 2018 年 11 月 27 日
i have two array A ,B i need to know all elements that inside A but not B including reptitons ,thx .

採用された回答

Star Strider
Star Strider 2018 年 11 月 27 日
編集済み: Star Strider 2018 年 11 月 27 日
Experiment with the ismember (link) funciton or if you are using floating-point numbers, ismembertol (link):
A = randi(9, 1, 10)
B = randi(5, 1, 8)
L = ismember(A, B)
Out = A(L)
or:
Out = A(~L)
depending on the result you want.
  2 件のコメント
daniel zayed
daniel zayed 2018 年 11 月 27 日
thx :)
Star Strider
Star Strider 2018 年 11 月 27 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by