Math Help - Matlab help wwith matrices

1. Matlab help wwith matrices

Hello all,
I am working on Matlab and need some help. How can I search for a single element from a nx2 matrix? for example:

if A = 12 0
15 1
17 0
19 0
20 1
then how can I find out whether the value of '20' is '1' or '0' ?
I'm just using this as a flag and cant seem to figure it out. Is there any other way to do this?

Thank you.

2. Originally Posted by neosam
Hello all,
I am working on Matlab and need some help. How can I search for a single element from a nx2 matrix? for example:

if A = 12 0
15 1
17 0
19 0
20 1
then how can I find out whether the value of '20' is '1' or '0' ?
I'm just using this as a flag and cant seem to figure it out. Is there any other way to do this?

Thank you.
Code:
>a20=A(find(A(:,1)==20),2);
Note if there is no "20" in the first column you should end up with an empty matrix

CB