Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
auto_extraction of same value position

Subject: auto_extraction of same value position

From: ravi

Date: 28 May, 2010 02:58:03

Message: 1 of 3

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

Subject: auto_extraction of same value position

From: Walter Roberson

Date: 28 May, 2010 03:02:23

Message: 2 of 3

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)

Subject: auto_extraction of same value position

From: ravi

Date: 28 May, 2010 03:16:03

Message: 3 of 3


Appreciate the help Walter.

best
ravi







Walter Roberson <roberson@hushmail.com> wrote in message <4nGLn.40814$wV.5092@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)

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us