主要内容

rlocusplot

Root locus plot of dynamic system

    Description

    The rlocusplot function plots the root locus of a dynamic system model. To customize the plot, you can return an RLocusPlot object and modify it using dot notation. For more information, see Customize Linear Analysis Plots at Command Line.

    To obtain feedback gains and complex root locations, use the rlocus function.

    rlocusplot(sys) plots the root locus of the SISO dynamic system model sys.

    To produce a smooth plot, the rlocusplot function automatically selects a set of positive feedback gains.

    example

    rlocusplot(sys1,sys2,...,sysN) plots the root loci of multiple models on a single plot.

    rlocusplot(sys1,LineSpec1,...,sysN,LineSpecN) sets the line style, marker type, and color for the plot of each system.

    rlocusplot(___,k) plots responses for feedback gains specified in k. You can specify a frequency range or a vector of frequencies. You can use k with any of the input argument combinations in previous syntaxes.

    rlocusplot(___,plotoptions) plots the root locus with the plotting options specified in plotoptions. Settings you specify in plotoptions override the plotting preferences for the current MATLAB® session.

    rlocusplot(___,Name=Value) specifies response properties using one or more name-value arguments. For example, rlocusplot(sys,MarkerSize=10) sets the pole and zero marker sizes to 10. (since R2026a)

    • When plotting responses for multiple systems, the specified name-value arguments apply to all responses.

    • The following name-value arguments override values specified in other input arguments.

      • FeedbackGainSpec — Overrides frequency values specified using w

      • Color — Overrides colors specified using LineSpec

      • MarkerStyle — Overrides marker styles specified using LineSpec

      • LineStyle — Overrides line styles specified using LineSpec

    rlocusplot(parent,___) plots the root locus in the specified parent graphics container, such as a Figure or TiledChartLayout, and sets the Parent property. Use this syntax when you want to create a plot in a specified open figure or when creating apps in App Designer.

    rlp = rlocusplot(___) plots the root locus and returns the corresponding chart object. To customize the appearance and behavior of the response plot, modify the chart object properties using dot notation.

    Examples

    collapse all

    Plot the root locus of a SISO dynamic system model.

    sys = tf([2 5 1],[1 2 3]);
    rlp = rlocusplot(sys);

    MATLAB figure

    Input Arguments

    collapse all

    Dynamic system, specified as a SISO dynamic system model or array of dynamic system models. Dynamic systems that you can use include:

    • Continuous-time or discrete-time numeric LTI models, such as tf, zpk, or ss models.

    • Generalized or uncertain LTI models such as genss or uss (Robust Control Toolbox) models. Using uncertain models requires Robust Control Toolbox™ software.

      • For tunable control design blocks, the function evaluates the model at its current value to plot the response.

      • For uncertain control design blocks, the function plots the nominal value and random samples of the model.

    • Identified LTI models, such as idtf (System Identification Toolbox), idss (System Identification Toolbox), or idproc (System Identification Toolbox) models. Using identified models requires System Identification Toolbox™ software.

    If sys is an array of models, the plot shows responses of all models in the array on the same axes.

    Line style, marker, and color, specified as a string or character vector containing symbols. The symbols can appear in any order. You do not need to specify all three characteristics. For example, specify the marker and omit the line style, then the plot shows only the marker and no line.

    Example: '--or' is a red dashed line with circle markers.

    Line StyleDescription
    "-"Solid line
    "--"Dashed line
    ":"Dotted line
    "-."Dash-dotted line
    MarkerDescription
    "o"Circle
    "+"Plus sign
    "*"Asterisk
    "."Point
    "x"Cross
    "_"Horizontal line
    "|"Vertical line
    "s"Square
    "d"Diamond
    "^"Upward-pointing triangle
    "v"Downward-pointing triangle
    ">"Right-pointing triangle
    "<"Left-pointing triangle
    "p"Pentagram
    "h"Hexagram
    ColorDescription
    "r"red
    "g"green
    "b"blue
    "c"cyan
    "m"magenta
    "y"yellow
    "k"black
    "w"white

    Feedback gain values that pertain to pole locations, specified as a vector. The feedback gains define the trajectory of the poles thereby affecting the shape of the root locus plot.

    Pole-zero plot options, specified as a pzoptions object. You can use these options to customize the PZ plot appearance. Settings you specify in plotoptions override the preference settings for the current MATLAB session.

    Parent graphics container, specified as one of these objects:

    • Figure

    • TiledChartLayout

    • UIFigure

    • UIGridLayout

    • UIPanel

    • UITab

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: rlocusplot(sys,LegendDisplay="off") hides the response of sys from the plot legend.

    Feedback gain values that pertain to pole locations, specified as a vector. The feedback gains define the trajectory of the poles thereby affecting the shape of the root locus plot.

    Response name, specified as a string or character vector and stored as a string.

    Response visibility, specified as one of these logical on/off values:

    • "on", 1, or true — Display the response in the plot.

    • "off", 0, or false — Do not display the response in the plot.

    The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

    Option to list the response in the legend, specified as one of these logical on/off values:

    • "on", 1, or true — List the response in the legend.

    • "off", 0, or false — Do not list the response in the legend.

    The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

    Marker style, specified as one of these values. Specifying a marker style using a name-value argument overrides any marker style that you specify using LineSpec.

    MarkerDescription
    "none"No marker
    "o"Circle
    "+"Plus sign
    "*"Asterisk
    "."Point
    "x"Cross
    "_"Horizontal line
    "|"Vertical line
    "s"Square
    "d"Diamond
    "^"Upward-pointing triangle
    "v"Downward-pointing triangle
    ">"Right-pointing triangle
    "<"Left-pointing triangle
    "p"Pentagram
    "h"Hexagram

    Plot color, specified as an RGB triplet or a hexadecimal color code and stored as an RGB triplet. Specifying a color using a name-value argument overrides any color that you specify using LineSpec.

    You can also specify some common colors by name. This table lists these colors and their corresponding RGB triplets and hexadecimal color codes.

    Color NameRGB TripletHexadecimal Color Code

    "red" or "r"

    [1 0 0]#FF0000

    "green" or "g"

    [0 1 0]#00FF00

    "blue" or "b"

    [0 0 1]#0000FF

    "cyan" or "c"

    [0 1 1]#00FFFF

    "magenta" or "m"

    [1 0 1]#FF00FF

    "yellow" or "y"

    [1 1 0]#FFFF00

    "black" or "k"

    [0 0 0]#000000

    "white" or "w"

    [1 1 1]#FFFFFF

    Line style, specified as one of these values. Specifying a line style using a name-value argument overrides any line style that you specify using LineSpec.

    Line StyleDescription
    "-"Solid line
    "--"Dashed line
    ":"Dotted line
    "-."Dash-dotted line
    "none"No line

    Marker size, specified as a positive scalar.

    Line width, specified as a positive scalar.

    Series index, specified as a positive integer or "none".

    By default, the SeriesIndex property is a number that corresponds to the order in which the response was added to the chart, starting at 1. MATLAB uses the number to calculate indices for automatically assigning color, line style, or markers for responses. Any responses in the chart that have the same SeriesIndex number also have the same color, line style, and markers.

    A SeriesIndex value of "none" indicates that a response does not participate in the indexing scheme.

    Output Arguments

    collapse all

    Chart object, returned as a RootLocusPlot object. To customize your plot appearance and behavior, modify the properties of this object using dot notation. For more information, see RLocusPlot Properties.

    More About

    collapse all

    Version History

    Introduced before R2006a

    expand all