From: Natalie Sin Hwee on
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
From: us on
"Natalie Sin Hwee " <sin.ng09(a)imperial.ac.uk> wrote in message <hvao3c$gek$1(a)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