Seeing if a value is in a matrix

5 views (last 30 days)
This is a rather simple question, but I'm sort of stumped by it. I want to write a bit of code that returns a 1 or 0 based on whether or not a value is in a matrix. For example comparing a=[3] with b=[1 2 3 4 5] would result in a 1, but comparing a=[6] to b=[1 2 3 4 5] would result in a 0.

Accepted Answer

Fangjun Jiang
Fangjun Jiang on 14 Sep 2011
ismember()

More Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!