S-function executes only if clock is present in Simulink file
Show older comments
Hi all, I have a general questions about using Matlab S-functions. I'm using a Level-2 m file as an S-function to simulate a simple model. When I just use an M-S-function block in simulink and provide all parameters and the inputs needed for it and then start simulating. I see that the start(block) function is executed and also the terminate() function but the update, output and derivative functions are never called. If I simply add the clock block to the simulink model with a terminator at its output everything runs as expected.
Why is that?
Thanks for any help.
Answers (3)
Kaustubha Govind
on 14 Mar 2012
0 votes
Turn on 'Format>Sample Time Display>Colors' on your model without the Clock block. What colors do you see? This may provide us some clue of what is going on. Also, which Solver have you selected from the Configuration Parameters window?
xlr8t
on 14 Mar 2012
0 votes
xlr8t
on 26 Mar 2012
0 votes
1 Comment
Kaustubha Govind
on 30 Mar 2012
Just to verify if it the S-function or your model that is the cause, could you try with a copy of the S-function block that's used in the demo 'msfcndemo_limintm'? You can just type the name of the model in the MATLAB prompt to open it.
Categories
Find more on Simulink 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!