COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Grouping data in close vicinity

• Follow

```I need help with grouping the data.

firs I want to group the data in rows of the matrix where the number of the zeros between the data are less than TOL.
For instance  assuming TOL=2 for the first row of the matrix it will be 2 group:

a(1,:)=[ 1 2 5 0 1 0 0 0 0 1 0 1]

then I want to group the created groups iin each row, with those of other rows if they are in close vicinity (TOL) , and put a rectangular around them while plotting, and each time if the cluster is updated, to remove the former cluster or fade it somehow.
a=[ 1 2 5 0 0 0 1 0 0 1 0 1;...
7 2 0 0 0 0 1 0 4 1 0 1;...
1 0 0 1 0 0 0  1 0 2 6 1]

the final out put will be following
out1=[1 2 5 0 ;...
7 2 0 0;...
1 0 0 1]

Out2=[1 0 0 1 0 1;...
1 0 4 1 0 1;...
0 1 0 2 6 1]

so, then the rectangular will be first around [1 2 5];
then when it iterates to the next row, it will be around [1 2 5; 7 2 0]
and at next step will be around Out1.

I guess I already grouped them in each row but I don't know how to combine them together, (however, I even doubt it whether I did it correctly)
```
 0
Reply khanmoradi (52) 12/15/2011 12:07:08 AM

0 Replies
22 Views

(page loaded in 0.081 seconds)

3/3/2013 10:06:25 PM

 Reply: