Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Elementary Functions > Log - exp - power > power

power

(^,.^) power operation

Syntax

t=A^b
t=A**b
t=A.^b

Arguments

A,t

scalar, polynomial or rational matrix.

b

a scalar, a vector or a scalar matrix.

Description

  • If A is a square matrix and b is a scalar then A^b is the matrix A to the power b.

  • If b is a scalar and A a matrix then A.^b is the matrix formed by the element of A to the power b (element-wise power). If A is a vector and b is a scalar then A^b and A.^b performs the same operation (i.e. element-wise power).

  • If A is a scalar and b is a square matrix A^b is the matrix expm(log(A) * b).

    If A is a scalar and b is a vector A^b and A.^b are the vector formed by a^(b(i,j)).

    If A is a scalar and b is a matrix A.^b is the matrix formed by a^(b(i,j)).

  • If A and b are vectors (matrices) of the same size A.^b is the A(i)^b(i) vector (A(i,j)^b(i,j) matrix).

Additional Remarks

Notes:

1. For square matrices A^p is computed through successive matrices multiplications if p is a positive integer, and by diagonalization if not (see "note 2 and 3" below for details).

2. If A is a square and Hermitian matrix and p is a non-integer scalar, A^p is computed as:

A^p = u*diag(diag(s).^p)*u' (For real matrix A, only the real part of the answer is taken into account).

u and s are determined by [u,s] = schur(A) .

3. If A is not a Hermitian matrix and p is a non-integer scalar, A^p is computed as:

A^p = v*diag(diag(d).^p)*inv(v) (For real matrix A, only the real part of the answer is taken into account).

d and v are determined by [d,v] = bdiag(A+0*%i) .

4. If A and p are real or complex numbers, A^p is the principal value determined by:

A^p = exp(p*log(A)) (or A^p = exp(p*(log(abs(A))+ %i*atan(imag(A)/real(A)))) ).

5. If A is a square matrix and p is a real or complex number, A.^p is the principal value computed as:

A.^p = exp(p*log(A)) (same as case 4 above).

6. ** 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 is equal to (2^3)^4 in Matlab® and Octave.

Examples

A=[1 2;3 4];
A^2.5,
A.^2.5
(1:10)^2
(1:10).^2

A^%i
A.^%i
exp(%i*log(A))

s=poly(0,'s')
s^(1:10)

See also

  • exp — element-wise exponential
  • hat — (^) exponentiation
Report an issue
<< polar Log - exp - power sqrt >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:49:19 CET 2020