I am writing an Image program
i want to do something like this
if I have a Matrix
A = 1 0 0
. 1 1 0


and
B= 1 0 0 1 1 1 1 0 0
. 1 1 0 0 0 1 1 1 0
. 1 0 0 1 1 1 1 0 0
. 1 1 0 0 0 1 1 1 1

here A repeated 3 time in B
(i.e B contains 3 3x2 matrix = A )

how can i do this ?
i mean that i need to know the number of repeatations