出力の初期値をfal​seに設定しておき、​ある条件が成立した場​合に出力を更新する方​法

出力の初期値がfalseで、いくつかの条件文があり、条件を満たすとtrueを出力する関数をモデルで表現するにはどのようにすべきでしょうか。(2015a)
例えば以下のような関数です。
boolean func(void)
{
boolean rtn ;
rtn = false ; //出力を初期化しておく
if ( flgA == true )
{
rtn = true ;
}
if ( flgB == true )
{
rtn = true ;
}
return ( rtn ) ;
}

 Respuesta aceptada

Toshinobu Shintai
Toshinobu Shintai el 26 de Jun. de 2020

0 votos

この構造であれば、Logical Operatorを使ってorをとれば作れます。添付ファイルを参照してください。

Más respuestas (0)

Categorías

Más información sobre Biomedical Imaging en Centro de ayuda y File Exchange.

Preguntada:

el 26 de Jun. de 2020

Respondida:

el 26 de Jun. de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!