フィルターのクリア

find common elements from cell array and remove it

7 ビュー (過去 30 日間)
Niharika  Nayak
Niharika Nayak 2019 年 12 月 30 日
コメント済み: Niharika Nayak 2019 年 12 月 31 日
I have two cell arrays A and B
A={1,2,3,4}
B={2,3}
remove elements from A that is present in cell array B
and answer should be
{1,4}

採用された回答

Andrei Bobrov
Andrei Bobrov 2019 年 12 月 30 日
out = A(~ismember([A{:}],[B{:}]));
  2 件のコメント
Bhaskar R
Bhaskar R 2019 年 12 月 30 日
If
B={1,2,3,4};
A={2,3};
out = A(~ismember([A{:}],[B{:}])); %?
Niharika  Nayak
Niharika Nayak 2019 年 12 月 31 日
Thanks it works

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by