Enable Not Working on Synchronous Subsystem
이전 댓글 표시
I have a synchronous subsystem that I want to enable only under certain conditions to avoid things like divide by zero errors. Unfortunately, adding an enable input seems to have no effect.
I created a very simple example that shows this problem:
Here is the top level of the model where I feed a sine wave into the subsystem and only enable when the value is greater than zero:

And here is the Enabled Synchronous Subsystem where I am simply calculating the reciprocal of the input.

If I run this simulation, I get divide by zero errors and the ouput appears as if the subsystem is always enabled:

Hwever, if i remove the Synchronous State Control Block, the output behaves as I would expect:

Why is this happening? Is this behavior as expected? I want to use Synchronous State Control because I will be generating HDL code from my model.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

