Compare to constant block doesn't work.
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Adriana Maria
el 19 de Jun. de 2018
Comentada: Adriana Maria
el 20 de Jun. de 2018
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
0 comentarios
Respuesta aceptada
Fangjun Jiang
el 19 de Jun. de 2018
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 comentarios
Fangjun Jiang
el 19 de Jun. de 2018
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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Sources en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!