Scilab-Branch-5.3-GIT

Please note that the recommended version of Scilab is 6.0.1. This page might be outdated.

See the recommended documentation of this function

# bool2s

convert boolean matrix to a zero one matrix.

### Calling Sequence

bool2s(x)

### Arguments

- x
a boolean vector or a boolean matrix or a constant matrix

### Description

If `x`

is a boolean matrix,
`bool2s(x)`

returns the matrix where "true" values are replaced by 1
and "false" value by 0.

If `x`

is a "standard" matrix,
`bool2s(x)`

returns the matrix where non-zero values are replaced by 1.

### Examples

bool2s([%t %t %f %t]) bool2s([2.3 0 10 -1])

## Comments

Add a comment:Please login to comment this page.