Why does my 'S-Function' block Run Four Times per Timestep?
Show older comments
My 'S-Function' block has no inputs, only outputs. One output is a counter, representing the number of times my 'S-Function' block is called. The block seems to be called 4 times per timestep when I step through my model.
My model uses a fixed-step ODE4 solver. I thought it was an algebraic loop causing this error, but adding a Unit Delay did not solve my problem.
Is this behavior expected? How can I make the 'S-Function' block run once per timestep?
Accepted Answer
More Answers (0)
Categories
Find more on Configure C/C++ S-Function Features in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!