From: Walter Roberson on
Pinpress wrote:

> I need to choose the first element of a vector that's modified by a
> conditional statement. For example, suppose:
>
> I = [1 2 3 4];
> R = logical( [0 1 0 1] );
>
> Then I(R) returns [2 4]. What I need to do is to find "2" and assign it
> to a new variable, which has to be a one element. I can do the following:
>
> t = I(R); t = t(1);

t = I(find(R,1))