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 (System Identification Toolbox).

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
impulseplotImpulse response
initialplotInitial condition response
lsimplotSimulated time response to arbitrary inputs
stepplotStep plot
bodeplotFrequency response plot
nicholsplotNichols plot
nyquistplotNyquist plot
sigmaplotSingular value plot
pzplotImpulse plot
iopzplotPole-zero map for input-output pairs
rlocusplotRoot locus plot
hsvplotHankel singular values plot

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

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 before R2006a

expand all