Max-plus algebra the power of A
[Z] = maxpluspwr(A,n)
This function returns Z = A⊗n and, Z is an maxplus identity if n = 0. If A is a square matrix, n must be non-negative integers. If A is not a square matrix or n is not non-negative integers operation is not defined.
a = [-%inf -%inf -%inf 17; 4. 7. -%inf -%inf; -%inf -%inf -%inf 14; 15. 13. 13. -%inf]; z=maxpluspwr(a,0) z = 0. -Inf -Inf -Inf -Inf 0. -Inf -Inf -Inf -Inf 0. -Inf -Inf -Inf -Inf 0. z=maxpluspwr(a,4) z = 64. 62. 62. 51. 43. 41. 41. 53. 61. 59. 59. 48. 49. 52. 47. 64. // An error output if n < 0 z=maxpluspwr(a,-4) !--error 10000 maxpluspwr: empty input matrix or n < 0 at line 22 of function called by : z=maxpluspwr(a,-4) // The dimension of matrix is not square ( 4 x 3), // return error a = [-%inf -%inf 13; 18. 11. -%inf; -%inf -%inf -%inf; 1. -%inf -%inf]; z=maxpluspwr(a,4) !--error 10000 maxpluspwr is defined only for square matrix! at line 28 of function called by : z=maxpluspwr(a,4) | ![]() | ![]() |