Unknown change in result across add block

Hi,
I'm running a relatively simple model that has four cases, one of which will only every be true. When the case is false, it returns a zero value. These four cases are connected to an ADD block so that the answer, which comes from the only true case and is non-zero.
The problem I'm having is that the result from the one true case changes from one side of the add block to the other for no apparent reason!
Has anyone come across this before, or have any idea how to solve it?
Thanks in advance, Sean

 采纳的回答

This sounds like it could be a numerical issue related to signal data types / block data type setting. E.g. the add block could be set to some rounding or the block works in an unexpected way when you input logical.
You can also consider to use appropriate blocks from the "Logic and Bit Operations" library instead of the add block.

1 个评论

Sounds like a good guess. Next time, you could add a screenshot :-)

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Simulink 的更多信息

产品

标签

Community Treasure Hunt

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

Start Hunting!

Translated by