Scilab Objects, boolean variables and operators & | ~
A boolean variable is %T
(for "true") or %F
(for "false"). These variables can be used to define matrices of booleans, with the usual syntax. Boolean matrices can be manipulated as ordinary matrices for elements extraction/insertion and concatenation.
![]() | Note that other usual operations ( + , * , - , ^ , etc) are undefined for boolean matrices. Three special operators are defined for boolean matrices: |
is the element-wise negation of boolean b
(matrix).
is the element-wise logical and
of
b1
and b2
(matrices).
is the element-wise logical
or
of b1
and b2
(matrices).
Boolean variables can be used for indexing matrices or vectors. For instance a([%T,%F,%T],:)
returns the submatrix made of rows 1
and 3
of a
. Boolean sparse matrices are supported.