- Scilab help
- Scilab
- Scilab keywords
- TMPDIR
- abort
- add_demo
- argn
- banner
- boolean
- break
- clear
- clearfun
- clearglobal
- comp
- continue
- debug
- delbpt
- dispbpt
- edit
- errcatch
- errclear
- error
- error_table
- exists
- exit
- external
- extraction
- format
- funcprot
- funptr
- getdebuginfo
- getmd5
- getmemory
- getmodules
- getos
- getscilabmode
- getshell
- getvariablesonstack
- getversion
- gstacksize
- ieee
- insertion
- intppty
- inv_coeff
- iserror
- isglobal
- lasterror
- macr2lst
- macr2tree
- matrices
- matrix
- mode
- mtlb_mode
- names
- newfun
- null
- pause
- perl
- poly
- predef
- quit
- rational
- readgateway
- resume
- sciargs
- scilab
- setbpt
- stacksize
- startup
- symbols
- testmatrix
- type
- typename
- user
- varn
- ver
- warning
- what
- where
- whereami
- who
- who_user
- whos
- with_atlas
- with_javasci
- with_macros_source
- with_module
- with_pvm
- with_texmacs
- with_tk
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
boolean
Scilab Objects, boolean variables and operators & | ~
Description
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 booleans matrices, three special operators are defined for boolean
matrices:
- ~b
is the element wise negation of boolean
b
(matrix).- b1&b2
is the element wise logical
and
ofb1
andb2
(matrices).- b1|b2
is the element wise logical
or
ofb1
andb2
(matrices).- Boolean variables can be used for indexing matrices or vectors.
For instance
a([%T,%F,%T],:)
returns the submatrix made of rows1
and3
ofa
. Boolean sparse matrices are supported.
Examples
[1,2]==[1,3] [1,2]==1 a=1:5; a(a>2)
See Also
<< banner | Scilab | break >> |