find common elements from cell array and remove it

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

If
B={1,2,3,4};
A={2,3};
out = A(~ismember([A{:}],[B{:}])); %?
Thanks it works

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2019년 12월 30일

댓글:

2019년 12월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by