Method on @sym: mpower (x, y)
Operator on @sym: x ^ y

Symbolic expression matrix exponentiation.

Scalar example:

syms x
sym('x')^3
  ⇒ ans = (sym)
       3
      x

The ^ notation is use to raise a matrix to a scalar power:

A = [sym(pi) 2; 0 x]
  ⇒ A = (sym 2×2 matrix)
      ⎡π  2⎤
      ⎢    ⎥
      ⎣0  x⎦
A^2
  ⇒ (sym 2×2 matrix)
      ⎡ 2           ⎤
      ⎢π   2⋅x + 2⋅π⎥
      ⎢             ⎥
      ⎢        2    ⎥
      ⎣0      x     ⎦
A^2 == A*A
  ⇒ (sym 2×2 matrix)
      ⎡True  True⎤
      ⎢          ⎥
      ⎣True  True⎦

Using this for scalar raised to a matrix power is not yet supported.

See also: @sym/power.

Package: symbolic