Clear Filters
Clear Filters

Comparing Contents of Two Matrices

1 view (last 30 days)
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 ];

Accepted Answer

Guillaume
Guillaume on 12 Aug 2016
all(ismember(A, B))

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!