From: ravi on
Hi,

I have 2 vectors:

A = [1;
2;
3;
4]

&

B = [6;
7;
8;
9]


I want to extract number 4 from vector A, so I use A(A>3)

Now, I want to automatically get the corresponding value 9 from matrix B , without using B(B>8).

Please help.
Ravi
From: Walter Roberson on
ravi wrote:

> I have 2 vectors:
>
> A = [1; 2;
> 3;
> 4]
>
> &
>
> B = [6;
> 7;
> 8;
> 9]
>
>
> I want to extract number 4 from vector A, so I use A(A>3)
>
> Now, I want to automatically get the corresponding value 9 from matrix B
> , without using B(B>8).

T = A>3;
A(T)
B(T)

Alternately,

T = find(A>3);
A(T)
B(T)

From: ravi on

Appreciate the help Walter.

best
ravi







Walter Roberson <roberson(a)hushmail.com> wrote in message <4nGLn.40814$wV.5092(a)newsfe11.iad>...
> ravi wrote:
>
> > I have 2 vectors:
> >
> > A = [1; 2;
> > 3;
> > 4]
> >
> > &
> >
> > B = [6;
> > 7;
> > 8;
> > 9]
> >
> >
> > I want to extract number 4 from vector A, so I use A(A>3)
> >
> > Now, I want to automatically get the corresponding value 9 from matrix B
> > , without using B(B>8).
>
> T = A>3;
> A(T)
> B(T)
>
> Alternately,
>
> T = find(A>3);
> A(T)
> B(T)