bodeoptions

Create list of Bode plot options

Syntax

P = bodeoptions
P = 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 and System Identification Toolbox Preferences Editor. For more information about the editor, see Toolbox Preferences Editor. 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 character vector, for example 'Amplitude'.

  • FontSizeDefault: 8

  • FontWeightDefault: 'Normal'

  • Font AngleDefault: 'Normal'

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

  • InterpreterDefault: 'tex'

TickLabel

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

  • FontSize Default: 8

  • FontWeight Default: 'Normal'

  • Font AngleDefault: 'Normal'

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

GridShow or hide the grid
Specified as one of the following values: 'off' | 'on'
Default: 'off'
GridColorColor of the grid lines
Specified as one of the following: Vector of RGB values in the range [0,1] | character vector of color name | 'none'. For example, for yellow color, specify as one of the following: [1 1 0], 'yellow', or 'y'.
Default: [0.15,0.15,0.15]
XlimMode, YlimModeAxis limit modes. Default: 'auto'
Xlim, Ylim Axes limits, specified as an array of the form [min,max]
IOGrouping Grouping of input-output pairs
Specified as one of the following values: 'none' |'inputs'|'outputs'|'all'
Default: 'none'
InputLabels, OutputLabels Input and output label styles
InputVisible, OutputVisibleVisibility 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 values:

  • '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'

FreqScale Frequency scale
Specified as one of the following values: 'linear' | 'log'
Default: 'log'
MagUnits Magnitude units
Specified as one of the following values: 'dB' | 'abs'
Default: 'dB'
MagScale Magnitude scale
Specified as one of the following values: 'linear' | 'log'
Default: 'linear'
MagVisibleMagnitude plot visibility
Specified as one of the following values: 'on' | 'off'
Default: 'on'
MagLowerLimMode Enables a lower magnitude limit
Specified as one of the following values: 'auto' | 'manual'
Default: 'auto'
MagLowerLimSpecifies the lower magnitude limit
PhaseUnits Phase units
Specified as one of the following values: 'deg' | 'rad'
Default: 'deg'
PhaseVisible Phase plot visibility
Specified as one of the following values: 'on' | 'off'
Default: 'on'
PhaseWrapping Enables phase wrapping
Specified as one of the following values: 'on' | 'off'
When you set PhaseWrapping to 'on', the plot wraps accumulated phase at the value specified by the PhaseWrappingBranch property.
Default: 'off'
PhaseWrappingBranchPhase value at which the plot wraps accumulated phase when PhaseWrapping is set to 'on'.
Default: –180 (phase wraps into the interval [–180º,180º))
PhaseMatching Enables phase matching
Specified as one of the following values: 'on' | 'off'
Default: 'off'
PhaseMatchingFreqFrequency for matching phase
PhaseMatchingValue The value to which phase responses are matched closely

Examples

collapse all

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.

Create a Bode plot that uses 14-point red text for the title. This plot should look the same, regardless of the preferences of the MATLAB session in which it is generated.

First, create a default options set.

opts = bodeoptions;

Change properties of the options set.

opts.Title.FontSize = 14;
opts.Title.Color = [1 0 0];
opts.FreqUnits = 'Hz';

Create a plot using the options.

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

Because opts begins with a fixed set of options, the plot result is independent of the toolbox preferences of the MATLAB session.

Introduced in R2008a