bodeoptions

Syntax

P = bodeoptionsP = bodeoptions('cstprefs')

Description

P = bodeoptions returns a default set
of plot options for use with the bodeplot.
You can use these options to customize the Bode plot appearance using
the command line. This syntax is useful when you want to write a script
to generate plots that look the same regardless of the preference
settings of the MATLAB® session in which you run the script.

P = bodeoptions('cstprefs') initializes
the plot options with the
options you selected in the Control System Toolbox Preferences
Editor. For more information about the editor, see Toolbox Preferences Editor in
the User's Guide documentation. This syntax is useful when you want
to change a few plot options but otherwise use your default preferences.
A script that uses this syntax may generate results that look different
when run in a session with different preferences.

The following table
summarizes the Bode plot options.

Option

Description

Title,
XLabel, YLabel

Label text and style, specified as a structure with the following
fields:

String — Label text, specified
as a string

FontSize — Default: 8

FontWeight — Default: 'Normal'

Font Angle — Default: 'Normal'

Color — Vector of RGB values
ranging from 0 to 1. Default: [0,0,0]

Interpreter — Default: 'tex'

TickLabel

Tick label style, specified as a structure with the following
fields:

FontSizeDefault:
8

FontWeight — Default: 'Normal'

Font Angle — Default: 'Normal'

Color — Vector of RGB values
ranging from 0 to 1. Default: [0,0,0]

Grid

Show or hide the gridSpecified as one of the following strings: 'off' | 'on'Default: 'off'

XlimMode, YlimMode

Axis limit modes. Default: 'auto'

Xlim, Ylim

Axes limits, specified as an array of the form [min,max]

IOGrouping

Grouping of input-output pairsSpecified
as one of the following strings: 'none' |'inputs'|'output'|'all'Default: 'none'

InputLabels, OutputLabels

Input and output label styles

InputVisible, OutputVisible

Visibility of input and output channels

ConfidenceRegionNumberSD

Number of standard deviations to use to plotting the
response confidence region (identified models only).

Default: 1.

FreqUnits

Frequency units, specified as one of the following strings:

'Hz'

'rad/second'

'rpm'

'kHz'

'MHz'

'GHz'

'rad/nanosecond'

'rad/microsecond'

'rad/millisecond'

'rad/minute'

'rad/hour'

'rad/day'

'rad/week'

'rad/month'

'rad/year'

'cycles/nanosecond'

'cycles/microsecond'

'cycles/millisecond'

'cycles/hour'

'cycles/day'

'cycles/week'

'cycles/month'

'cycles/year'

Default: 'rad/s'

You
can also specify 'auto' which uses frequency units rad/TimeUnit relative
to system time units specified in the TimeUnit property.
For multiple systems with different time units, the units of the first
system are used.

FreqScale

Frequency scaleSpecified as one of the following strings: 'linear' | 'log'Default: 'log'

MagUnits

Magnitude unitsSpecified
as one of the following strings: 'dB' | 'abs'Default: 'dB'

MagScale

Magnitude scaleSpecified
as one of the following strings: 'linear' | 'log'Default: 'linear'

MagVisible

Magnitude plot visibilitySpecified as one of the following strings: 'on' | 'off'Default: 'on'

MagLowerLimMode

Enables a lower magnitude limitSpecified as
one of the following strings: 'auto' | 'manual'Default: 'auto'

MagLowerLim

Specifies the lower magnitude limit

PhaseUnits

Phase unitsSpecified
as one of the following strings: 'deg' | 'rad'Default: 'deg'

PhaseVisible

Phase plot visibilitySpecified as one of the following strings: 'on' | 'off'Default: 'on'

PhaseWrapping

Enables phase wrappingSpecified as one of the following strings: 'on' | 'off'Default: 'off'

PhaseMatching

Enables phase matchingSpecified as one of the following
strings: 'on' | 'off'Default: 'off'

Examples

Create a Bode plot that suppresses the phase plot and uses frequency units Hz instead of the default radians/second. Otherwise, the plot uses the settings that are saved in the toolbox preferences.

First, create an options set based on the toolbox preferences.

opts = bodeoptions('cstprefs');

Change properties of the options set.

opts.PhaseVisible = 'off';
opts.FreqUnits = 'Hz';

Create a plot using the options.

h = bodeplot(tf(1,[1,1]),opts);

Depending on your own toolbox preferences, the plot you obtain might look different from this plot. Only the properties that you set explicitly, in this example PhaseVisible and FreqUnits, override the toolbox preferences.