How can I make the settling time or rise time automatically display when using the STEP function from the Control Systems Toolbox? When I use the STEP function to plot the step response of an LTI system, I would like the settling time to display automatically without having to select it from the UIcontextmenu.
Prashant Kumar answered .
2025-11-20
The Control Systems Toolbox does not explicitly offer this functionality. However, you can manipulate some handle properties to obtain this result. Once the STEP function has been used to create the time response plot, first obtain the handle for the "Settling Time" UIcontextmenu option using the FINDALL function. This can be done in the following manner:
h4 = findall(gcf,'Label','Settling Time');
Once you have the handle for the "Settling Time" UIcontextmenu option, evaluate the callback associated with the handle. This callback displays the settling time on the plot, and is executed whenever the user left-clicks on the "Settling Time" option in the menu. To obtain the callback property of the "Settling Time" UIcontextmenu option, use the GET function:
A=get(h4,'Callback');
The contents of the "Callback" property includes the callback function handle and the input arguments to the function:
A =
[@localCallback ]
[1x1 resppack.timeplot]
'Settling Time'
'resppack.StepSettleTimeData'
'resppack.SettleTimeView'
To have this callback executed automatically, the FEVAL function is used in the following manner:
feval(A{1},h4,[],A{2:5});