出力の初期値をfalseに設定しておき、ある条件が成立した場合に出力を更新する方法
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
徹 矢吹
am 26 Jun. 2020
Beantwortet: Toshinobu Shintai
am 26 Jun. 2020
出力の初期値がfalseで、いくつかの条件文があり、条件を満たすとtrueを出力する関数をモデルで表現するにはどのようにすべきでしょうか。(2015a)
例えば以下のような関数です。
boolean func(void)
{
boolean rtn ;
rtn = false ; //出力を初期化しておく
if ( flgA == true )
{
rtn = true ;
}
if ( flgB == true )
{
rtn = true ;
}
return ( rtn ) ;
}
0 Kommentare
Akzeptierte Antwort
Toshinobu Shintai
am 26 Jun. 2020
この構造であれば、Logical Operatorを使ってorをとれば作れます。添付ファイルを参照してください。
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Biomedical Imaging finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!