Replace step response data in an existing plot with data computed from a different dynamic system model.
Suppose you have a plant model and pure integrator controller that you designed for that plant. Plot the step responses of the plant and the closed-loop system.
h
is the plot handle that identifies the plot created by stepplot
. In this figure, G
is used to compute the first response, and CL1
is used to compute the second response. This ordering corresponds to the order of inputs to stepplot
.
Suppose you also have a PID controller design that you want to analyze. Create a model of the closed-loop system using this alternate controller.
Update the step plot to display the second closed-loop system instead of the first. The closed-loop system is the second response in the plot, so specify the index value 2.
The updateSystem
command replaces the system used to compute the second response displayed in the plot. Instead of displaying response data derived from CL1
, the plot now shows data derived from CL2
.
When you build a GUI that displays a response plot, use updateSystem
in GUI control callbacks to cause those GUI controls to update the response plot. For an example showing how to implement such a GUI control, see Build GUI With Interactive Response-Plot Updates.