Main Content

trendChart

Plot trend analysis charts

Since R2024b

Description

Use the trendChart to plot a trend analysis chart with specified x- and y-axes from an adeDataReader object.

Creation

Description

Tchart = trendChart(obj,Name=Value) plots a trend chart from the adeDataReader object obj using the Name-Value pair arguments. Unspecified arguments take default values.

Note

You must provide the Yaxis argument.

example

Input Arguments

expand all

Object containing the trend chart data, specified as an adeDataReader object.

Data Types: char

Name-Value Arguments

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: fig = trendChart(obj,Yaxis='Iload') plots the Iloadon the y-axis of a trend chart from the adeDataReader object and returns the object handle fig.

Fields to be plotted on the x-axis of the trend chart, specified as a cell array of strings.

Data Types: char

Field to be plotted on the y-axis of the trend chart, specified as a string.

Note

You must provide the Yaxis argument.

Data Types: char

Legends for trend chart, specified as a cell array of strings.

Data Types: char

Handle of figure axes of the trend chart, specified as object handle.

Data Types: char

Output Arguments

expand all

Trend chart object containing the axes information, legends, and trend chart plot.

Data Types: char

Examples

collapse all

Unzip the ldo_test_Interactive.244.zip file. Load the ldo_test_Interactive.244.mat file containing the adeInfo object data.

unzip('ldo_test_Interactive.244.zip');
data = adeDataReader('ldo_test_Interactive.244.mat');

Find the variables for trend chart analysis.

fields = data.TrendChartFields;

Plot trend chart of Phase Margin against cfb, Iload, and temperature.

fig = trendChart(data,Yaxis='Phase Margin',Xaxis={fields{2},fields{1},fields{4}})

Figure contains an axes object. The axes object with ylabel Phase Margin contains 4 objects of type line, text. This object represents Phase Margin.

fig = 
  trendChart with properties:

    InputFile: [1×1 adeDataReader]
        Xaxis: {'cfb'  'Iload'  'temperature'}
        Yaxis: {'Phase Margin'}
       Legend: {}
      FigAxes: [1×1 Axes]

Update the plot to observe the trend of gain margin instead of phase margin against the same variables.

fig.Yaxis = "Gain Margin"

Figure contains an axes object. The axes object with ylabel Gain Margin contains 4 objects of type line, text. This object represents Gain Margin.

fig = 
  trendChart with properties:

    InputFile: [1×1 adeDataReader]
        Xaxis: {'cfb'  'Iload'  'temperature'}
        Yaxis: {'Gain Margin'}
       Legend: {}
      FigAxes: [1×1 Axes]

Use the corModelSpec as a legend and update the plot.

fig.Legend = fields{3}

Figure contains an axes object. The axes object with ylabel Gain Margin contains 7 objects of type line, text. These objects represent Gain Margin , corModelSpec=gpdk045.scs Section=ff;, Gain Margin , corModelSpec=gpdk045.scs Section=fs;, Gain Margin , corModelSpec=gpdk045.scs Section=sf;, Gain Margin , corModelSpec=gpdk045.scs Section=ss;.

fig = 
  trendChart with properties:

    InputFile: [1×1 adeDataReader]
        Xaxis: {'cfb'  'Iload'  'temperature'}
        Yaxis: {'Gain Margin'}
       Legend: {'corModelSpec'}
      FigAxes: [1×1 Axes]

If you accidentally close the plot window, you can bring it back.

fig.show

Version History

Introduced in R2024b