I have a vector A = [1 3 5 4 2]. I have a vector of the form B = [2 4 5]. How do I check if all the values in vector B are in vector A?

2 views (last 30 days)
I have a vector A = [1 3 5 4 2]. I have a vector of the form B = [2 4 5]. How do I check if all the values in vector B are in vector A?

Accepted Answer

Adam Danz
Adam Danz on 23 Jul 2018
Edited: Adam Danz on 23 Jul 2018
ismember()
all(ismember())

More Answers (0)

Categories

Find more on Data Types 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!