<< mps_ones mpscilab mps_prec >>

mpscilab >> mpscilab > mps_pow

mps_pow

Element-wise exponentiation

Calling Sequence

mps_pow( rop, op1, op2 )
rop = mps_pow( op1, op2 )

Overloaded usage:

rop=op1 .^ op2

Arguments

rop

multi-precision matrix

op1, op2

multi-precision or Scilab matrices or scalars

Description

Set rop to the element-wise exponentiation of op1 and op2.

mps_pow( rop, op1, op2 )

Set rop to the element-wise exponentiation of op1 and op2.

rop = mps_pow( op1, op2 )

Creates a multi-precision matrix the same size and precision as op containing the result.

rop=op1 .^ op2

Overloaded Scilab element-wise exponentiation operation.

Usage notes

Like most mps functions the mps_pow( rop, op1, op2 ) form is faster and can reuse the space of an existing matrix but requires an already initialized operand. Also, the same form can be used to perform an in-place operation when rop and op are the same.

Examples

// Two MPS matrix.
A = [1 2; 3 4]
B = [4 3; 2 1]
mpsA = mps_init2(A,100)
mpsB = mps_init2(B,100)
rop = mps_init(2,2,100)
mps_pow(rop,mpsA,mpsB)

// MPS matrix and a Scilab double scalar.
A = [1 2; 3 4]
mpsA = mps_init2(A,100)
rop = mps_init(2,2,100)
mps_pow(rop,mpsA,2)

// In-place addition mpsA = mpsA .^ mpsB. This is done without any intermediary
// variable or storage.
A = [1 2; 3 4]
B = [4 3; 2 1]
mpsA = mps_init2(A,100)
mpsB = mps_init2(B,100)
mps_pow(mpsA,mpsA,mpsB)

//Overloaded usage
A = [1 2; 3 4]
B = [4 3; 2 1]
mpsA = mps_init2(A,100)
mpsB = mps_init2(B,100)
rop = mpsA .^ mpsB

See Also

<< mps_ones mpscilab mps_prec >>