<< mps_lessequal Comparison functions Introduction >>

mpscilab >> mpscilab > Comparison functions > mps_lessgreater

mps_lessgreater

Less or greater predicate operation

Calling Sequence

rop = mps_lessgreater( op1, op2 )

Overloaded usage:

rop = op1 <> op2

Arguments

rop

Scilab matrix of boolean

op1, op2

multi-precision or Scilab matrices or scalars

Description

Compare each elements of op1 and op2 and set the corresponding element of the boolean matrix rop to True if they are less or greater than each other or False otherwise.

rop = mps_lessgreater( rop, op1, op2 )

Compare each elements of op1 and op2 and set the corresponding element of the boolean matrix rop to True if they are less or greater than each other or False otherwise.

rop = op1 <> op2

Overloaded Scilab inequality comparison.

Limitations

Currently op1 and op2 must be of the same size. Support for comparing a matrix with a single scalar is not implemented yet.

The overloaded case uses the Scilab inequality operator. However, lessgreater will return False when either one or both of the input arguments is an NaN while an inequality operator would return True.

Examples

// Equality comparison between two MPS matrices.
A = [1 2; 3 4]
B = [1 2; 5 4]
mpsA = mps_init2(A,100)
mpsB = mps_init2(B,100)
rop = mps_lessgreater(mpsA,mpsB)

//Overloaded usage
A = [1 2; 3 4]
B = [1 2; 5 4]
mpsA = mps_init2(A,100)
mpsB = mps_init2(B,100)
rop = mpsA <> mpsB
<< mps_lessequal Comparison functions Introduction >>