Method on @symfun: mpower (f, n)
Operator on @symfun: f ^ n

Symbolic function exponentiation.

Example:

syms x y
f(x, y) = [x 0; 2 y];

h = f ^ 2
  ⇒ h(x, y) = (symfun)
      ⎡    2        ⎤
      ⎢   x       0 ⎥
      ⎢             ⎥
      ⎢            2⎥
      ⎣2⋅x + 2⋅y  y ⎦

The exponent can also be a @symfun:

syms g(x)
f(x) = sym([2 0; 3 1]);

h = f^g
  ⇒ h(x) = (symfun)
      ⎡    g(x)      ⎤
      ⎢   2         0⎥
      ⎢              ⎥
      ⎢   g(x)       ⎥
      ⎣3⋅2     - 3  1⎦

See also: @symfun/power.

Package: symbolic