Skip to content

mpower

Matrix power (A ^ B).

C = mpower(A, B)

Returns A^B — matrix A raised to the matrix or scalar power B. For positive integer B, this is repeated matrix multiplication. For non-integer or matrix B, computed via eigendecomposition: A^B = V * D^B * inv(V) where [V, D] = eig(A). Same as the ^ operator on matrices.

For elementwise array power, use .^ or power.

A = [1 1; 0 1];
A^3 % [1 3; 0 1] matrix cube
A^0 % [1 0; 0 1] identity
  • mtimes — Matrix multiplication (A * B).
  • expm — Matrix exponential.
  • sqrtm — Matrix square root.