Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - English

Scilab 6.0.1
Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Boolean > bool2s

bool2s

convert boolean matrix to a zero one matrix.

Syntax

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])

See also

  • boolean — Scilab Objects, boolean variables and operators & | ~
  • find — find indices of boolean vector or matrix true elements
Report an issue
<< Boolean Boolean Integers >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 19:26:51 CET 2018