MAMBO logo MAMBO & the MAMBO Toolbox MAMBO logo

&>,&>=,&<,&<=,&==,&!= — Boolean operators in MotionOutput [mupad/matlab]

(v&>w)

(v&>=w)

(v&<w)

(v&<=w)

(v&==w)

(v&!=w)

v, w: expressions

The Boolean binary operator &> can be used in the anims and insignals components of a call to MotionOutput to represent a conditional expression whose value equals 1 if the left argument is greater than the right argument and 0 otherwise.

The Boolean binary operator &>= can be used in the anims and insignals components of a call to MotionOutput to represent a conditional expression whose value equals 1 if the left argument is greater than or equal to the right argument and 0 otherwise.

The Boolean binary operator &< can be used in the anims and insignals components of a call to MotionOutput to represent a conditional expression whose value equals 1 if the left argument is less than the right argument and 0 otherwise.

The Boolean binary operator &<= can be used in the anims and insignals components of a call to MotionOutput to represent a conditional expression whose value equals 1 if the left argument is less than or equal to the right argument and 0 otherwise.

The Boolean binary operator &== can be used in the anims and insignals components of a call to MotionOutput to represent a conditional expression whose value equals 1 if the left argument equals the right argument and 0 otherwise.

The Boolean binary operator &!= can be used in the anims and insignals components of a call to MotionOutput to represent a conditional expression whose value equals 1 if the left argument differs from the right argument and 0 otherwise.

The Boolean operators are implemented as functions. It follows that the expression v&>w is equivalent to `&>`(v,w). Since function evaluation has higher priority than arithmetic operations, parentheses must be used to delimit the arguments of the Boolean operators.

v&>3;

Boolean Operator Output

2+v&>3;

Boolean Operator Output

(2+v)&>3;

Boolean Operator Output

MotionOutput(ode={},anims=[k=(sin(2*Pi*t)&>=0),
   good_on=(n1^2+n2^2+n3^2)&!=0]);

   time t;
anims {
k = (sin(2*Pi*t)>= 0);
good_on = (n1^2 + n2^2 + n3^2!= 0);
}

MotionOutput(ode={},anims=[bad_on=n1^2+n2^2+n3^2&!=0]);

   anims {
bad_on = n3^(2!= 0) + n1^2 + n2^2;
}


Toolbox functions