How can I reset continuous states at a discontinuity in a C-mex S-function

I am trying to create a C-mex S-function with a discontinuity handling of continuous states.
After the discontinuity is detected using the mdlZeroCrossings, I am looking for the proper way to reset the values of some of the continuous states at the event point.
What is the proper way to reset a continuous state depending on the mode at the discontinuity event ?

Answers (0)

Products

Asked:

on 17 Apr 2013

Community Treasure Hunt

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

Start Hunting!