How can I make the settling time or rise time automatically

U
uttamsingh · Dec 18, 2020 · 2.4K views
Question
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.
Expert Answer
Profile picture of Prashant Kumar
Prashant Kumar PhD Expert
Answered Aug 24, 2026

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});
Note that the FEVAL command accepts the callback function handle and input arguments. The first 2 arguments to callback functions are always the same in MATLAB 6.5 (R13). The first argument is the handle to the object that has its callback executing. The second argument is called eventdata, and it is always empty in MATLAB 6.5 (R13).
Note that the instructions above only show you the settling time of your system on the graph. If you would like to programatically calcuate the settling time of your system, see the Related Solution below:
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!