Main Content

getoptions

(Not recommended) Get options for linear analysis plot object

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

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

Description

opts = getoptions(plotobj) returns the options for the plot associated with linear analysis chart object plotobj.

  • You can use opts when creating new plots of the same type as plotobj.

  • To customize an existing plot, you can modify opts and then use the resulting options object with setoptions.

example

optValue = getoptions(plotobj,option) returns the specified option, option, for the plot associated with chart object plotobj.

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

Option name, specified as a string or character vector. To see the supported options for a specific plot type, see the corresponding option object page indicated in opts.

Output Arguments

collapse all

Plot options, returned 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)

Option value, returned as a scalar, vector, character vector, logical value, structure, or cell array depending on the option specified in option.

Alternative Functionality

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

bp = bodeplot(sys);
phaseUnits = bp.PhaseUnits;

Version History

Introduced in R2012a

expand all

See Also