Main Content
mpower, ^
Symbolic matrix power
Syntax
Description
Examples
Matrix Base and Scalar Exponent
Create a 2
-by-2
matrix.
A = sym('a%d%d', [2 2])
A = [ a11, a12] [ a21, a22]
Find A^2
.
A^2
ans = [ a11^2 + a12*a21, a11*a12 + a12*a22] [ a11*a21 + a21*a22, a22^2 + a12*a21]
Scalar Base and Matrix Exponent
Create a 2
-by-2
symbolic magic square.
A = sym(magic(2))
A = [ 1, 3] [ 4, 2]
Find πA.
sym(pi)^A
ans = [ (3*pi^7 + 4)/(7*pi^2), (3*(pi^7 - 1))/(7*pi^2)] [ (4*(pi^7 - 1))/(7*pi^2), (4*pi^7 + 3)/(7*pi^2)]