Download Sysquake User Manual

Transcript
LME Reference — logical functions
493
Examples
a=1:3; a([1,0,1])
Index out of range
a=1:3; a(logical([1,0,1]))
1 3
See also
islogical, uint8, double, char, setstr, operator ()
true
Boolean constant true.
Syntax
b
B
B
B
=
=
=
=
true
true(n)
true(n1, n2, ...)
true([n1, n2, ...])
Description
The boolean constant true can be used to set the value of a variable.
It is equivalent to logical(1). The constant 1 is equivalent in many
cases; indices (to get or set the elements of an array) are an important
exception.
With input arguments, true builds a logical array whose elements
are true. The size of the array is specified by one integer for a square
matrix, or several integers (either as separate arguments or in a vector) for an array of any size.
Examples
true
true
islogical(true)
true
true(2)
T T
T T
See also
false, logical, ones
xor
Exclusive or.