SyntaxFix
Write A Post
Hire A Developer
Questions
you can do:
A = randi(10, [3 4]); %# a random matrix any( A(:)==5 ) %# does A contain 5?
To do the above in a vectorized way, use:
any( bsxfun(@eq, A(:), [5 7 11] )
or as @woodchips suggests:
ismember([5 7 11], A)