Most programming languages have a built-in implementation of exponentiation for integers and reals only.



Task

Demonstrate how to implement matrix exponentiation as an operator.




function [output] = matrixexponentiation(matrixA, exponent)
   output = matrixA^(exponent);