A=[1 1 5 6; 2 2 1 5; 3 1 4 2; 4 4 2 1; 5 6 2 1;]B=[1 1 1; %remain
1 4 2; 1 5 6; 2 1 5; 4 2 1; 4 2 2; %remain 6 2 1; 6 3 1;] %remain
I would like the output, C to display
C=[1 1 1; 4 2 2; 6 3 1;]
I tried the following:
[idx1,idx2] = ismember(A(:,2:4),B,'rows');
However, when I used ~
[idx1,idx2] = ~ismember(A(:,2:4),B,'rows');
An error's returned.
May I know why is this so and any suggestions on how to get around this?
Best Answer