Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語 -

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

Справка Scilab >> Development tools > Assert > assert_checktrue

assert_checktrue

Check that condition is true.

Calling Sequence

flag = assert_checktrue ( condition )
flag = assert_checktrue ( condition )
[flag,errmsg] = assert_checktrue ( condition )

Parameters

condition:

a matrix of booleans

flag :

a 1-by-1 matrix of boolean, %t if condition is true, %f if not

errmsg :

a 1-by-1 matrix of strings, the error message. If flag==%t, then errormsg=="". If flag==%f, then errmsg contains the error message.

Description

Performs silently if all entries in condition are true.

Generates an error if any entry in the condition matrix is false. Generates an error if condition is not a boolean.

If any entry in condition is false,

  • if the errmsg output variable is not used, an error is generated,

  • if the errmsg output variable is used, no error is generated.

Examples

// Tests which pass
assert_checktrue ( %t );
flag = assert_checktrue ( %t )
[flag,errmsg] = assert_checktrue ( %t )
[flag,errmsg] = assert_checktrue ( [%t %t] );

// Tests which fail
assert_checktrue ( [%t %f] );
flag = assert_checktrue ( [%t %f] )
// No error generated
[flag,errmsg] = assert_checktrue ( [%t %f] )

// Wrong calls
assert_checktrue ( "a" )

History

ВерсияОписание
5.4.0 Function introduced
Report an issue
<< assert_checkfilesequal Assert assert_comparecomplex >>

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 02 14:01:18 CEST 2014