ctrlplot 223
Description
This function performs some common control system related plotting. The user can use
ctrlplot to set up a basic plot and perform some preprocessing of the data. This
generates a graphical object containing the data and the user can perform subsequent
calls to plot to add things like text, labels, gridding etc. The second argument
(optional) is a graphical object to which the pdm will be added.
Plots over a domain (bode, timeresp, logmagplot, phaseplot) must be called with a pdm.
A matrix or scalar can be turned into a suitable pdm with the conpdm function. Nyquist
and Nichols plots can also plot scalars. Points such as -1 are often useful. The user
should specify a marker so that such points show up. When mixing scalar and pdm data
on a Nyquist or Nichols plot, plot the pdm data first to get a reasonable choice of axes.
For Bode plots, two graphs are created — the magnitude and the phase plots — and
positioned one above the other. The result is returned as a single graphical object.
Similarly, when adding data to Bode plots, the existing graphical object must also
contain two subplots.
Default labels, corresponding to the most common use of the particular invocation, are
put on the axes. These can be overwritten with subsequent calls to plot.
Examples:
# Create 2 systems.
sys1 = 1/makepoly([1,1],"s")
sys2 = 2*sys1*10/makepoly([1,1,10],"s")
w1 = logspace(0.01,10,50)’
w2 = sort([w1;[0.35:0.01:0.65]’])
sys1g = freq(sys1,w1)
sys2g = freq(sys2,w2)
# Bode plots
g1 = ctrlplot(sys1g,{bode});
g1 = ctrlplot(sys2g,g1,{bode});
g1 = plot({keep=g1,title = "Bode plots",...