Main Content

hsvoptions

Create list of Hankel singular value plot options

    Description

    Use the hsvoptions command to create a HSVPlotOptions object to customize Hankel singular value (HSV) plot appearance. You can also use the command to override the plot preference settings in the MATLAB® session in which you create the HSV plots.

    Creation

    Description

    example

    plotoptions = hsvoptions returns a default set of plot options for use with the hsvplot command. You can use these options to customize the HSV 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.

    example

    plotoptions = hsvoptions('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. 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.

    Properties

    expand all

    Scale for Y-axis, specified as either 'log' or 'linear'.

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

    • String — Label text, specified as a character vector. By default, the plot is titled 'Hankel Singular Values and Approximation Error'.

    • FontSize — Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals 1/72 inch.

    • FontWeight — Character thickness, specified as 'Normal' or 'bold'. MATLAB uses the FontWeight property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.

    • FontAngle — Character slant, specified as 'Normal' or 'italic'. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.

    • Color — Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet [0,0,0].

    • Interpreter — Text interpreter, specified as one of these values:

      • 'tex' — Interpret characters using a subset of TeX markup. This is the default value of Interpreter.

      • 'latex' — Interpret characters using LaTeX markup.

      • 'none' — Display literal characters.

    X-axis label text and style, specified as a structure with the following fields:

    • String — Label text, specified as a character vector. By default, the axis is titled 'Order (Number of States)'.

    • FontSize — Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals 1/72 inch.

    • FontWeight — Character thickness, specified as 'Normal' or 'bold'. MATLAB uses the FontWeight property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.

    • FontAngle — Character slant, specified as 'Normal' or 'italic'. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.

    • Color — Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet [0,0,0].

    • Interpreter — Text interpreter, specified as one of these values:

      • 'tex' — Interpret characters using a subset of TeX markup. This is the default value of Interpreter.

      • 'latex' — Interpret characters using LaTeX markup.

      • 'none' — Display literal characters.

    Y-axis label text and style, specified as a structure with the following fields:

    • String — Label text, specified as a cell array of character vectors. By default, the axis label is titled 'State Contribution'.

    • FontSize — Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals 1/72 inch.

    • FontWeight — Character thickness, specified as 'Normal' or 'bold'. MATLAB uses the FontWeight property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.

    • FontAngle — Character slant, specified as 'Normal' or 'italic'. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.

    • Color — Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet [0,0,0].

    • Interpreter — Text interpreter, specified as one of these values:

      • 'tex' — Interpret characters using a subset of TeX markup. This is the default value of Interpreter.

      • 'latex' — Interpret characters using LaTeX markup.

      • 'none' — Display literal characters.

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

    • FontSize — Font size, specified as a scalar value greater than zero in point units. The default font size depends on the specific operating system and locale. One point equals 1/72 inch.

    • FontWeight — Character thickness, specified as 'Normal' or 'bold'. MATLAB uses the FontWeight property to select a font from those available on your system. Not all fonts have a bold weight. Therefore, specifying a bold font weight can still result in the normal font weight.

    • FontAngle — Character slant, specified as 'Normal' or 'italic'. Not all fonts have both font styles. Therefore, the italic font might look the same as the normal font.

    • Color — Text color, specified as an RGB triplet. The default color is black specified by the RGB triplet [0,0,0].

    Toggle grid display on the plot, specified as either 'off' or 'on'.

    Color of the grid lines, specified as an RGB triplet. The default color is light grey specified by the RGB triplet [0.15,0.15,0.15].

    Selection mode for the x-axis limits, specified as one of these values:

    • 'auto' — Enable automatic limit selection, which is based on the total span of the plotted data.

    • 'manual' — Manually specify the axis limits. To specify the axis limits, set the XLim property.

    Selection mode for the y-axis limits, specified as one of these values:

    • 'auto' — Enable automatic limit selection, which is based on the total span of the plotted data.

    • 'manual' — Manually specify the axis limits. To specify the axis limits, set the YLim property.

    X-axis limits, specified as a cell array of two-element vector of the form [min,max].

    Y-axis limits, specified as a cell array of two-element vector of the form [min,max].

    Object Functions

    hsvplotPlot Hankel singular values and return plot handle

    Examples

    collapse all

    Use hsvplot to create a Hankel singular-value plot and customized plot properties.

    Create an options set for hsvplot that sets the Yscale property and the title font size.

    P = hsvoptions;
    P.YScale = 'linear'; 
    P.Title.FontSize = 14;

    Use the options set to generate an HSV plot. Note the linear y-axis scale in the plot.

    h = hsvplot(rss(12),P);

    Figure contains an axes object. The axes object with title Hankel Singular Values and Approximation Error contains 3 objects of type bar, line. These objects represent Unstable modes, Stable modes, Absolute error bound.

    hsvplot returns a plot handle. You can use the plot handle to change properties of the existing plot. For example, switch to log scale and turn off the grid.

    setoptions(h,'Yscale','log','Grid','Off')

    Figure contains an axes object. The axes object with title Hankel Singular Values and Approximation Error contains 3 objects of type bar, line. These objects represent Unstable modes, Stable modes, Absolute error bound.

    Tips

    • Both balred and hsvplot generate Hankel singular-value plots. hsvplot is useful when you want to customize properties of your plot such as axis limits, scale, and label styles. Use hsvoptions with hsvplot to define properties for your plot. For information on the ways to change properties of your plots, see Ways to Customize Plots.

    Introduced in R2008a