15.2.6 Powers of a square matrix
The
matpow
command finds the power of a square matrix, computed using the Jordan form.
matpow
command takes two arguments:
A
, a square matrix.
n
, an integer.
matpow(
A
,
n
)
returns
A
n
.
Example
matpow
([[1,2],[2,1]],
n
)
⎡
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎣
3
n
+
⎛
⎝
−1
⎞
⎠
n
2
3
n
−
⎛
⎝
−1
⎞
⎠
n
2
3
n
−
⎛
⎝
−1
⎞
⎠
n
2
3
n
+
⎛
⎝
−1
⎞
⎠
n
2
⎤
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎦
Note:
jordan
([[1,2],[2,1]])
⎡
⎢
⎣
1
−1
1
1
⎤
⎥
⎦
,
⎡
⎢
⎣
3
0
0
−1
⎤
⎥
⎦