Documentation

iddataPlotOptions

Option set for iddata/plot

Syntax

  • opt = iddataPlotOptions('time')
    example
  • opt = iddataPlotOptions('frequency')
    example
  • opt = iddataPlotOptions(___,'identpref')
    example

Description

example

opt = iddataPlotOptions('time') creates the default option set for plotting time-domain data. Use dot notation to customize the option set, if needed.

example

opt = iddataPlotOptions('frequency') creates a default option set for plotting frequency-domain data. Use dot notation to customize the option set, if needed.

example

opt = iddataPlotOptions(___,'identpref') initializes the plot options with the System Identification Toolbox™ preferences. This syntax can include any of the input argument combinations in the previous syntaxes. Use this syntax to change a few plot options but otherwise use your toolbox preferences.

Examples

collapse all

Create Option Set for Plotting Time-Domain Data

Create an options set with default options for time-domain data.

opt = iddataPlotOptions('time');

Specify plot properties, such as time units and grid. View the plot in minutes

 opt.TimeUnits = 'minutes';
 % Turn grid on
 opt.Grid = 'on';

Create a plot using the specified options.

load iddata1 z1
h = plot(z1, opt);

Change Orientation of Input-Output Data Axes

Generate data with two inputs and one output.

z = iddata(randn(100,1),rand(100,2));

Configure a time plot.

opt = iddataPlotOptions('time');

Plot the data.

h = plot(z,opt);

Change the orientation of the plots such that all inputs are plotted in one column, and all outputs are in a second column.

opt.Orientation = 'two-column';
h = plot(z,opt);

Alternatively, use setoptions.

setoptions(h,'Orientation','two-column')

You can also change the orientation by right-clicking the plot and choosing Orientation in the context menu.

Create Option Set for Plotting Frequency-Domain Data

Create an option set with default options for frequency-domain data.

opt = iddataPlotOptions('frequency');

Specify plot properties, such as phase visibility and frequency units.

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

Create a plot with the specified options.

load iddata7 z7
zf = fft(z7);
h = plot(zf,opt);

Initialize a Plot Using Toolbox Preferences

opt = iddataPlotOptions('time','identpref');

Output Arguments

collapse all

opt — Option set for iddata/plotiddataPlotOptions option set

Option set containing the specified options for iddata/plot. The structure has the following fields:

Field Description
Title, XLabel, YLabelText 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 string.

    Default Title: 'Input-Output Data'

    Default XLabel: 'Time'

    Default YLabel: 'Amplitude'

  • FontSize — Font size, specified as scalar value greater than 0.
    Default: 8

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

  • Font Angle — Text character angle, specified as one of the following strings: '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 strings: 'tex' | 'latex'| 'none'
    Default: 'tex'

TickLabelTick label style, specified as a structure array with the following fields:
  • FontSize — Font size, specified as scalar value greater than 0.
    Default: 8

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

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

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

GridShow or hide the grid, specified as one of the following strings: 'off' | 'on'
Default: 'off'
GridColorColor of the grid lines, specified as one of the following: vector of RGB values in the range [0,1] | color string |'none'.
Default: [0.15,0.15,0.15]
XlimMode, YlimModeAxes limit modes, specified as one of the following strings:
  • 'auto' — The axis limits are based on the data plotted

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

Default: 'auto'
Xlim, YlimAxes limits, specified as maximum and minimum values.
Default: [0 1].
IOGroupingGrouping of input-output pairs, specified as one of the following strings: 'none' | 'inputs' | 'outputs'|'all'
Default: 'none'
InputLabels, OutputLabels

Input and output label styles on individual plot axes, 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 strings: 'Normal' | 'Bold'
    Default: 'Normal'

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

  • Color — Color of text, specified as a vector of RGB values between 0 to 1 | color string | 'none'.
    Default: [0.4,0.4,0.4]

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

InputVisible, OutputVisibleVisibility of input and output channels, specified as one of the following strings: 'off' | 'on'
Default: 'on'
OrientationOrientation of the input and output data plots, specified as one of the following strings:
  • 'two-row' — Plot all outputs in one row and all inputs in a second row

  • 'two-column' — Plot all outputs in one column and all inputs in a second column

  • 'single-row' — Plot all inputs and outputs in one row

  • 'single-column'— Plot all inputs and outputs in one column

Default: 'two-row'.

For time-domain data plots only:
FieldDescription
TimeUnitsTime units, specified as one of the following strings:
  • 'nanoseconds'

  • 'microseconds'

  • 'milliseconds'

  • 'seconds'

  • 'minutes'

  • 'hours'

  • 'days'

  • 'weeks'

  • 'months'

  • 'years'

You can also specify 'auto' which uses time units specified in the TimeUnit property of the data. For multiple systems with different time units, the units of the first system is used.

NormalizeNormalize responses, specified as one of the following strings: 'on' |'off'
Default: 'off'

For frequency-domain data plots only:
FieldDescription
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.

FreqScaleFrequency scale, specified as one of the following strings: 'linear' | 'log'
Default: 'log'
MagUnitsMagnitude units, specified as one of the following strings: 'dB' | 'abs'
Default: 'dB'
MagScaleMagnitude scale, specified as one of the following strings: 'linear' | 'log'
Default: 'linear'
MagVisibleMagnitude plot visibility, specified as one of the following strings: 'on' | 'off'
Default: 'on'
MagLowerLimModeEnables a lower magnitude limit, specified as one of the following strings: 'auto' | 'manual'
Default: 'auto'
MagLowerLimLower magnitude limit, , specified as data type double. It is typically decided by the range of the amplitudes the plotted data takes.
PhaseUnitsPhase units, specified as one of the following strings: 'deg' | 'rad'
Default: 'deg'
PhaseVisiblePhase plot visibility, specified as one of the following strings: 'on' | 'off'
Default: 'on'
PhaseWrappingEnable phase wrapping, specified as one of the following strings: 'on' | 'off'
Default: 'off'
PhaseMatchingEnable phase matching, specified as one of the following strings: 'on' | 'off'
Default: 'off'
PhaseMatchingFreqFrequency for matching phase, specified as data type double.
PhaseMatchingValueThe value to which phase responses are matched closely, specified as a real number representing the desired phase value PhaseMatchingFreq.

Introduced in R2014a

Was this topic helpful?