top of page
CPMSE Worked Examples
How should we do it?
1. We are going to call our matrix INMAT. We need to identify all the non-zero values in INMAT and assign them a number in a different matrix called CMAT:

2. The first step on the algorithm is making shifts to INMAT and CMAT in different directions.
The result will be stored into two matrices: IC and C. For example, if we make a shift to the right:
4. Then, logically adding these two results we get:


We will repeat the process from step 2 until CMAT does not change even if we shift it in all the different directions.

3. Now we make logical coparisons between INMAT and IC and between CMAT and C. This will allow us to identify some of the clusters.
