Matlab Count The Triangles