Main Content

spectrumoptions

Option set for spectrumplot

Description

example

opt = spectrumoptions creates the default option set for spectrumplot. Use dot notation to customize the option set, if needed.

example

opt = spectrumoptions('identpref') initializes the plot options with the System Identification Toolbox™ preferences. Use this syntax to change a few plot options but otherwise use your toolbox preferences.

Examples

collapse all

Specify the plot options.

plot_options = spectrumoptions;
plot_options.FreqUnits = 'Hz';
plot_options.FreqScale = 'linear';
plot_options.Xlim = {[0 20]};
plot_options.MagUnits = 'abs';

Estimate an AR model.

load iddata9 z9
sys = ar(z9,4);

Plot the output spectrum for the model.

spectrumplot(sys,plot_options);

opt = spectrumoptions('identpref');

Output Arguments

collapse all

Option set containing the specified options for spectrumplot.

FieldDescription

Title, XLabel, YLabel

Text and style for axes labels and plot title, specified as a structure array with the following fields:

  • String — Title and axes label text, specified as a character vector.

    Default Title: 'Power Spectrum'

    Default XLabel: 'Frequency'

    Default YLabel: 'Power'

  • FontSize — Font size, specified as data type scalar.
    Default: 8

  • FontWeight — Thickness of text, specified as one of the following values: 'Normal' | 'Bold'
    Default: 'Normal'

  • Font Angle — Text character angle, specified as one of the following values: 'Normal' | 'Italic'
    Default: 'Normal'

  • Color — Color of text, specified as vector of RGB values between 0 to 1.
    Default: [0,0,0]

  • Interpreter — Interpretation of text characters, specified as one of the following values: 'tex' | 'latex'| 'none'
    Default: 'tex'

TickLabel

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

  • FontSize — Font size, specified as data type scalar.
    Default: 8

  • FontWeight — Thickness of text, specified as one of the following values: 'Normal' | 'Bold'
    Default: 'Normal'

  • Font Angle — Text character angle, specified as one of the following values: 'Normal' | 'Italic'
    Default: 'Normal'

  • Color — Color of text, specified as vector of RGB values between 0 to 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,0,0]

Grid

Show or hide the grid, specified as one of the following values: 'off' | 'on'

Default: 'off'

GridColor

Color 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, YLimMode

Axes limit modes, specified as one of the following values:

  • 'auto' — The axes limits are based on the data plotted

  • 'manual' — The values are explicitly set with Xlim, Ylim

Default: 'auto'

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

Grouping of input-output pairs in the plot, specified as one of the following values: 'none' | 'inputs'| 'outputs'|'all'

Default: 'none'

InputLabels, OutputLabels

Input and output label styles, specified as a structure array with the following fields:

  • FontSize — Font size, specified as data type scalar.
    Default: 8

  • FontWeight — Thickness of text, specified as one of the following values: 'Normal' | 'Bold'
    Default: 'Normal'

  • Font Angle — Text character angle, specified as one of the following values: 'Normal' | 'Italic'
    Default: 'Normal'

  • Color — Color of text, specified as a vector of RGB values between 0 to 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.4,0.4,0.4]

  • Interpreter — Interpretation of text characters, specified as one of the following values: 'tex' | 'latex'| 'none'
    Default: 'tex'

InputVisible, OutputVisible

Visibility of input and output channels, specified as one of the following values: 'off' | 'on'

Default: 'on'

ConfidenceRegionNumberSD

Number of standard deviations to use to plot the response confidence region.

Default: 1

FreqUnits

Frequency units, specified as one of the following values:

  • 'Hz'

  • 'rad/s'

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

MagLowerLimMode

Enables a lower magnitude limit, specified as one of the following values: 'auto' | 'manual'

Default: 'auto'

MagLowerLimLower magnitude limit, specified as data type double.

Version History

Introduced in R2012a