MATLAB Answers

How can I determine which values in vector X are NOT in vector Y?

4 views (last 30 days)
Lewis Foggie
Lewis Foggie on 6 Apr 2020
Commented: Birdman on 6 Apr 2020
Consider:
x = [10 20 30]
y = [10 5 20 30]
What's the simplest way you can think of to output a vector Z which tells you which vectors in y appear in x...
Z = [1 0 1 1]
So Z tells you that 10 appears in y and x, 5 appears in y but not x, 20 appears in y and x, 30 appears in y and x.

  0 Comments

Sign in to comment.

Answers (1)

Products


Release

R2015b

Community Treasure Hunt

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

Start Hunting!