指数演算子 (^,.^)
t = A ^ b t = A ** b t = A .^ b
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.
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.
A
or b
must be a scalar,
and the other one must be a square matrix:
If A
is scalar and b
is
a square matrix, then A^b
is the matrix
expm(log(A) * b)
If A
is a square matrix and b
is scalar, then A^b
is the matrix
A
to the power b
.
正方行列の場合, A^p
は,
p
が正のスカラーの場合は行列の逐次乗算により計算され,
それ以外の場合,対角化により計算されます
(詳細は"注記2および3"を参照).
A
が正方かつエルミート行列で
p
が整数でないスカラーの場合,
A^p
は以下の様に計算されます:
A^p = u*diag(diag(s).^p)*u'
(A
が実数行列の場合,
答えの実部のみが考慮されます).
u
およびs
は, [u,s] = schur(A)
により定義されます.
A
がエルミート行列でなく,
p
が非整数スカラーの場合,
A^p
は以下の様に計算されます:
A^p = v*diag(diag(d).^p)*inv(v)
(A
が実数行列の場合, 答えの実部のみが考慮されます).
d
および v
は,
[d,v] = bdiag(A+0*%i)
により定義されます.
A
および p
が実数または複素数の場合,
A^p
は以下のように計算される
主値となります:
A
が正方行列で
p
が実数または複素数の場合,
A.^p
は以下のように計算される
主値 となります:
**
および ^
演算子は同義です.
![]() | 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. |
Version | Description |
6.0.0 | With decimal or complex numbers, scalar ^ squareMat now
yields expm(log(scalar)*squareMat) instead of
scalar .^ squareMat |