To modify BouncingBallNoGroundDetection.m
to BouncingBallGroundDetectionStop.m
to detect the first instant at which the ball strikes the ground,
simply change the MATLABŪ lines from:
% mdlDerivatives( t, VAR, uSimulink ); % UNCOMMENT FOR EVENT HANDLING
% mdlOutputs( t, VAR, uSimulink ); % UNCOMMENT FOR EVENT HANDLING
functionsToEvaluateForEvent = [];
eventTerminatesIntegration1Otherwise0ToContinue = [];
eventDirection_AscendingIs1_CrossingIs0_DescendingIsNegative1 = [];
to
mdlDerivatives( t, VAR, uSimulink );
mdlOutputs( t, VAR, uSimulink );
functionsToEvaluateForEvent = [ y ];
eventTerminatesIntegration1Otherwise0ToContinue = [ 1 ];
eventDirection_AscendingIs1_CrossingIs0_DescendingIsNegative1 = [ -1 ];
|