MATLAB: Comparing Contents of Two Matrices

comparing two matrices

How to determine if all elements of A are present in B, in the simplest way?
A = [ 1 2 3 ];
B = [ 1 2 3 4 5 6 7 8 9 10 ];

Best Answer

all(ismember(A, B))