mpower

Perform a matrix power operation, equivalent to the ^ operator.

Syntax

R = mpower(x,y)

Inputs

x,y
At most one of the arguments can be a matrix.
Dimension: scalar | matrix

Outputs

R
The power operation result.
Dimension: scalar | matrix

Examples

Matrix to a scalar power:
R = mpower([3, 2; 2, 3], 4)
R = [Matrix] 2 x 2
313  312
312  313
Scalar to a matrix power:
R = mpower(2, [3, 2; 2, 3])
R = [Matrix] 2 x 2
17.00000  15.00000
15.00000  17.00000

Comments

A matrix to a scalar power is only valid for a square matrix.

A scalar to a matrix power is equlvalent to expm(log(scalar)*matrix).