power
(^,.^) power operation
Syntax
t = A ^ b t = A ** b t = A .^ b
Arguments
- A, t
- a scalar, vector, or matrix of encoded integers, decimal or complex numbers, polynomials, or rationals.
- b
- a scalar, vector, or matrix of encoded integers, decimal or complex numbers.
If an operand are encoded integers, the other one can be only encoded integers or real numbers.
If A are polynomials or rationals, b can only be
a single decimal (positive or negative) integer.
Description
.^ by-element power
If A or b is scalar, it is first
replicated to the size of the other, with A*ones(b) or b*ones(A).
Otherwise, A and b must have the same size.
Then, for each element of index i, t(i) = A(i)^b(i)
is computed.
^ matricial power
A or b must be a scalar,
and the other one must be a square matrix:
If
Ais scalar andbis a square matrix, thenA^bis the matrixexpm(log(A) * b)If
Ais a square matrix andbis scalar, thenA^bis the matrixAto the powerb.
Remarks
For square matrices
A^pis computed through successive matrices multiplications ifpis a positive integer, and by diagonalization if not (see "note 2 and 3" below for details).If
Ais a square and Hermitian matrix andpis a non-integer scalar,A^pis computed as:A^p = u*diag(diag(s).^p)*u'(For real matrixA, only the real part of the answer is taken into account).uandsare determined by[u,s] = schur(A).If
Ais not a Hermitian matrix andpis a non-integer scalar,A^pis computed as:A^p = v*diag(diag(d).^p)*inv(v)(For real matrixA, only the real part of the answer is taken into account).dandvare determined by[d,v] = bdiag(A+0*%i).If
Aandpare real or complex numbers,A^pis the principal value determined byIf
Ais a square matrix andpis a real or complex number,A.^pis the principal value computed as:**and^operators are synonyms.
![]() | Exponentiation is right-associative in Scilab, contrarily to Matlab® and Octave.
For example 2^3^4 is equal to 2^(3^4) in Scilab, but to (2^3)^4 in Matlab® and Octave. |
Examples
See also
History
| Versão | Descrição |
| 6.0.0 | With decimal or complex numbers, scalar ^ squareMat now
yields expm(log(scalar)*squareMat) instead of
scalar .^ squareMat |
| Report an issue | ||
| << nthroot | Exponential | sqrt >> |
