Max-plus algebra the big power of A (i.e. A⊗m, 2p = m ≥ n)
[Z] = maxpluspwrbig(A,n)
This function returns Z = A⊗m, where m =2p with p is the smallest integer that satisfy 2p = m ≥ n. And n is not exceed 10300.
A = sprand(5,5,0.7); k = find(A == 0); A(k) = -%inf; A = round(10*A); A = full(A) Z = maxpluspwrbig(A,10^100)