Operands, specified as scalars or matrices. Inputs A
and B must be one of the following combinations:

Base A is a square matrix and exponent
B is a scalar. If B is
a positive integer, the power is computed by repeated squaring.
For other values of B the calculation
involves eigenvalues and eigenvectors.

Base A is a scalar and exponent
B is a square matrix. The calculation
uses eigenvalues and eigenvectors.

Operands with an integer data type cannot be complex.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char Complex Number Support: Yes

Tips

MATLAB^{®} computes X^(-1) and inv(X) in
the same manner, and both are subject to the same limitations. For
more information, see inv.

Extended Capabilities

C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

If A is a 2-by-2 or larger matrix and B is
Inf or -Inf, then
A^B returns a matrix of NaN
values.

For A^b, if b is a noninteger
scalar, then at least one of A or
b must be complex.

Code generation does not support sparse matrix inputs for this
function.

GPU Code Generation Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Usage notes and limitations:

If A is a 2-by-2 or larger matrix and
B is Inf or
-Inf, then A^B returns a
matrix of NaN values.

For A^b, if b is a noninteger
scalar, then at least one of A or
b must be complex.

Code generation does not support
sparse matrix inputs for this function.

GPU Arrays Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.

This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.