As you know, using loops with big size matrix results delay, in my case I need to free my code of loops for the same reason(delay). This is my code example:
for i=1:n
    for j=1:m-1
       Z=A(i,j);
       Z2= A(i,j+1);
       if X(Z,Z) == X(Z2,Z)
          X(Z2,Z) = X(Z2,Z)+1;
       end
     end
 end
So, are there any suggestion? Many thanks.
 
    