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:
'find' and placing into respective columns

Subject: 'find' and placing into respective columns

From: Natalie Sin Hwee

Date: 16 Jun, 2010 14:46:04

Message: 1 of 2

Dear Mathworks users ^^

I have a matrix of size 1000x1000
the cells contains values ranging between -pi to pi.

I want to 'find' the values that are between 0 and pi/4.
so i end up with a 1000x1000 containing 0's and 1's.

i then want to take those that satisfy (i.e. 1's) and place the position of the
cell into a new matrix e.g.

1 34 2 425 3 525 ....
1 87 2 476 3 756 .....
1 102 2 571 3 847 ....
1 834 2 827 3 928 ....

i.e.
column of 1's and then column of respective row number corresponding to the row+column of the 1 where it was found.

column of 2...

column of 3...

sorry if i 've made it soudn confusing but it is so hard for me to put matlab into words.
any hel-p will be great
many thanks

Natalie

Subject: 'find' and placing into respective columns

From: us

Date: 16 Jun, 2010 14:53:04

Message: 2 of 2

"Natalie Sin Hwee " <sin.ng09@imperial.ac.uk> wrote in message <hvao3c$gek$1@fred.mathworks.com>...
> Dear Mathworks users ^^
>
> I have a matrix of size 1000x1000
> the cells contains values ranging between -pi to pi.
>
> I want to 'find' the values that are between 0 and pi/4.
> so i end up with a 1000x1000 containing 0's and 1's.
>
> i then want to take those that satisfy (i.e. 1's) and place the position of the
> cell into a new matrix e.g.
>
> 1 34 2 425 3 525 ....
> 1 87 2 476 3 756 .....
> 1 102 2 571 3 847 ....
> 1 834 2 827 3 928 ....
>
> i.e.
> column of 1's and then column of respective row number corresponding to the row+column of the 1 where it was found.
>
> column of 2...
>
> column of 3...
>
> sorry if i 've made it soudn confusing but it is so hard for me to put matlab into words.
> any hel-p will be great
> many thanks
>
> Natalie

a hint:

     help find; % <- look at the various output options...

us

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