Compare to constant block doesn't work.

8 ビュー (過去 30 日間)
Adriana Maria
Adriana Maria 2018 年 6 月 19 日
コメント済み: Adriana Maria 2018 年 6 月 20 日
I don't know why the compare with constant doesn't work. I have tried to use a relational operation block, but it is the same problem. I missing something? Please see the picture attached: image.png

採用された回答

Fangjun Jiang
Fangjun Jiang 2018 年 6 月 19 日
What is the data type of "lamba5"? I assume it is double or single. This is a typical "floating point equal or unequal comparison" issue. Convert the "lamba5" to integer or logical if it applies. Otherwise, you have to compare a floating point value with a threshold value, for example, if abs(lamba5-1)<=1e-6.
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2018 年 6 月 19 日
You have to decide the best threshold value based on your application. If it is divided by (lamba5-1), you have to decide by "how much" when lamba5 is close to the value of 1 that you want to do something differently.
Adriana Maria
Adriana Maria 2018 年 6 月 20 日
Thank you very much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSources についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by