Download Sysquake User Manual

Transcript
270
Sysquake User Manual ©1999-2012, Calerga Sàrl
See also
operator ||, operator ?, operator &, if
Operator |
Or.
Syntax
b1 | b2
or(b1, b2)
Description
b1|b2 performs the logical OR operation between the corresponding
elements of b1 and b2; the result is false (logical 0) if both operands
are false or 0, and true (logical 1) otherwise.
or(b1,b2) is equivalent to b1|b2. It can be used to redefine this
operator for objects.
Example
[false, false, true, true] | [false, true, false, true]
F T T T
See also
operator &, xor, operator ˜, operator ||, any
Operator ||
Or with lazy evaluation.
Syntax
b1 || b2
Description
b1||b2 is b1 if b1 is true, and b2 otherwise. Like with if and while
statements, b1 is true if it is a nonempty array with only non-zero
elements. b2 is evaluated only if b1 is false.
b1||b2||...||bn returns the last operand which is true (remaining
operands are not evaluated), or the last one.
Example
Boolean value which is true if the vector v is empty or if its first element is NaN:
isempty(v) || isnan(v(1))