Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - 日本語

Change language to:
English - 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ヘルプ >> Development tools > Assert > assert_checktrue

assert_checktrue

条件がtrueであることを確認する.

呼び出し手順

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

パラメータ

condition:

論理値の行列

flag :

1行1列の論理値行列, 条件がtrueの場合に %t, そうでない場合に %f

errmsg :

1行1列の文字列行列,エラーメッセージ. flag==%t の場合, errmsg="". flag==%f の場合, errmsgにはエラーメッセージが代入されます.

説明

condition の全エントリがtrueの場合に そのまま実行されます.

conditionのエントリのどれかがfalseの場合に エラーが発生します. conditionが論理値でない場合にエラーが発生します.

conditionのエントリのどれかがfalseの場合,

  • 出力変数errmsgが使用されない場合,エラーが出力され,

  • 出力変数errmsgが使用される場合,エラーは出力されません.

// パスするテスト
assert_checktrue ( %t );
flag = assert_checktrue ( %t )
[flag,errmsg] = assert_checktrue ( %t )
[flag,errmsg] = assert_checktrue ( [%t %t] );
// 失敗するテスト
assert_checktrue ( [%t %f] );
flag = assert_checktrue ( [%t %f] )
// エラーは出力されません
[flag,errmsg] = assert_checktrue ( [%t %f] )
// 間違ったコール
assert_checktrue ( "a" )

履歴

バージョン記述
5.4.0 関数が導入されました
Report an issue
<< assert_checkfilesequal Assert assert_comparecomplex >>

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:
Thu Feb 14 15:02:37 CET 2019