Got Questions? Get Answers.
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:
Matrix manipulation based on size of numbers

Subject: Matrix manipulation based on size of numbers

From: Ulrik Nash

Date: 7 Sep, 2010 12:17:05

Message: 1 of 3

Hello,

I have a matrix A

A =

    1.0000 1.0000
    4.0000 0.8833
    2.0000 1.0000

and wish to create B:

B =

    1.0000
    2.0000

which is constructed from column 1 of A, where the corresponding values in column 2 of A is greater than 0.80.

How is this done?

Regards,

Ulrik.

Subject: Matrix manipulation based on size of numbers

From: Ulrik Nash

Date: 7 Sep, 2010 12:27:22

Message: 2 of 3

I meant:

which is constructed from column 1 of A, where the corresponding values in column 2 of A is greater than 0.90.

Apologies....

"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <i65ag1$3t8$1@fred.mathworks.com>...
> Hello,
>
> I have a matrix A
>
> A =
>
> 1.0000 1.0000
> 4.0000 0.8833
> 2.0000 1.0000
>
> and wish to create B:
>
> B =
>
> 1.0000
> 2.0000
>
> which is constructed from column 1 of A, where the corresponding values in column 2 of A is greater than 0.80.
>
> How is this done?
>
> Regards,
>
> Ulrik.

Subject: Matrix manipulation based on size of numbers

From: Oleg Komarov

Date: 7 Sep, 2010 12:28:24

Message: 3 of 3

"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <i65ag1$3t8$1@fred.mathworks.com>...
> Hello,
>
> I have a matrix A
>
> A =
>
> 1.0000 1.0000
> 4.0000 0.8833
> 2.0000 1.0000
>
> and wish to create B:
>
> B =
>
> 1.0000
> 2.0000
>
> which is constructed from column 1 of A, where the corresponding values in column 2 of A is greater than 0.80.
>
> How is this done?
>
> Regards,
>
> Ulrik.

A(A(:,2) > .8,1)

Oleg

Tags for 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