i would like to compare two matrixes with different dimension, A and B if any of the element in A is matched with B then that element in A has to be set to zero ?

조회 수: 2 (최근 30일)
A=[1 2 3 2 4 45 32 5] B=[5 6 4 8 2 6 4 8 4 6 98 5 4] then the result marix has to be A=[1 0 3 0 0 45 35 0] I tried with looping but it is slow since my marix set is too big. Please help me out. Thanks in advance

채택된 답변

Fangjun Jiang
Fangjun Jiang 2016년 8월 29일
A(ismember(A,B))=0

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by