Main Content

setoptions

(Not recommended) Set options for linear analysis plot object

setoptions is not recommended. Set plot options by accessing chart object properties using dot notation. For more information, see Version History.

setoptions is still recommended for idplot and spectrumplot. For more information, see setoptions.

Description

setoptions(plotobj,opts) sets options for the plot associated with linear analysis chart object plotobj to the options specified in opts.

setoptions(plotobj,Name=Value) specifies one or more plot options using name-value arguments. For example, setoptions(bp,PhaseUnit="rad") sets the phase units of Bode plot bp to radians.

To see the supported options for a specific plot type, see the corresponding option object page indicated in opts.

example

setoptions(plotobj,opts,Name=Value) first sets options using the values in opts, and then overrides specific options using the one or more name-value arguments.

Examples

collapse all

For this example, consider a MIMO state-space model with 3 inputs, 3 outputs and 3 states. Create an impulse plot with red colored grid lines.

Create the MIMO state-space model sys_mimo.

J = [8 -3 -3; -3 8 -3; -3 -3 8];
F = 0.2*eye(3);
A = -J\F;
B = inv(J);
C = eye(3);
D = 0;
sys_mimo = ss(A,B,C,D);
size(sys_mimo)

Create an impulse plot with plot handle h and use getoptions for a list of the options available.

h = impulseplot(sys_mimo)
p = getoptions(h)

Use setoptions to update the plot with the required customization.

setoptions(h,'Grid','on','GridColor',[1 0 0]);

The impulse plot automatically updates when you call setoptions. For MIMO models, impulseplot produces a grid of plots, each plot displaying the impulse response of one I/O pair.

Input Arguments

collapse all

Plot, specified as one of the following chart objects.

Chart ObjectDescription
impulseplot (Control System Toolbox)Impulse response
initialplot (Control System Toolbox)Initial condition response
lsimplot (Control System Toolbox)Simulated time response to arbitrary inputs
stepplot (Control System Toolbox)Step plot
bodeplot (Control System Toolbox)Frequency response plot
nicholsplot (Control System Toolbox)Nichols plot
nyquistplot (Control System Toolbox)Nyquist plot
sigmaplot (Control System Toolbox)Singular value plot
pzplot (Control System Toolbox)Impulse plot
iopzplot (Control System Toolbox)Pole-zero map for input-output pairs
rlocusplot (Control System Toolbox)Root locus plot
hsvplot (Control System Toolbox)Hankel singular values plot

Plot options, specified as one of the following plot option objects depending on the chart object specified in plotobj.

Option Objectplotobj Type
timeoptions (Control System Toolbox)
bodeoptions (Control System Toolbox)bodeplot (Control System Toolbox)
nicholsoptions (Control System Toolbox)nicholsplot (Control System Toolbox)
nyquistoptions (Control System Toolbox)nyquistplot (Control System Toolbox)
sigmaoptions (Control System Toolbox)sigmaplot (Control System Toolbox)
pzoptions (Control System Toolbox)
hsvoptions (Control System Toolbox)hsvplot (Control System Toolbox)

To obtain the options form an existing chart object, use getoptions.

Alternative Functionality

You can also set property values of linear analysis plot objects using dot notation. For example, set the phase units for a Bode plot to radians.

bp = bodeplot(sys);
bp.PhaseUnits = "rad";

Version History

Introduced in R2012a

expand all

See Also