Sunday, February 14, 2010

Find the element you want in matrix

a =

     1     2     3
     1     3     4
     1     4     5
     2     5     6
     2     6     7
     3     7     8
     2     8     9
     1     0     1
     2     1     2
the command:
b = find ( a ( : , 1 )= =2)
returns following results:

b =

     4
     5
     7
     9

the coomand:
c= a ( b , : )
returns following results:

c =

     2     5     6
     2     6     7
     2     8     9
     2     1     2


This is how to pick out all the rows in which the first element is 2 in matrix a and put them into c. I could have used this to handle my ozone historic data and it will be much easier.  

1 comment:

Any comments?

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...