power

Perform power operation, applied to matrices on an element-wise basis, equivalent to the .^ operator.

Syntax

R = power(x,y)

Inputs

x
The base.
Dimension: scalar
y
The exponent.
Dimension: scalar

Outputs

R
The power operation result.
Dimension: scalar | matrix

Example

Scalar raised to a scalar power:
R = power(2, 3)
R = 8
Matrix raised to a scalar power, element-wise:
R = power([2, 3; 4, 5], 2)
R = [Matrix] 2 x 2
 4   9
16  25
Matrix raised to a matrix power, element-wise:
R = power([2, 3; 4, 5], [3, 2; 2, 1])
R = [Matrix] 2 x 2
 8  9
16  5