Main Content

plot

Create plot for signal or multiple signals

Syntax

[signal_names, signal_figures] = cgv.CGV.plot(data_set)
[signal_names, signal_figures] = cgv.CGV.plot(data_set,'Signals', signal_list)

Description

[signal_names, signal_figures] = cgv.CGV.plot(data_set) create a plot for each signal in the data_set.

[signal_names, signal_figures] = cgv.CGV.plot(data_set,'Signals', signal_list) create a plot for each signal in the value of 'Signals' and return the names and figure handles for the given signal names.

Input Arguments

data_set

Output data from a model. After running the model, use the getOutputData function to get the data. The cgv.CGV.getOutputData function returns a cell array of the output signal names.

'Signals', signal_list

Parameter/value argument pair specifying the signal or signals to plot. The value for this parameter can be an individual signal name, or a cell array of character vectors, where each character vector is a signal name in the data_set. Use getSavedSignals to view the list of available signal names in the data_set. The syntax for an individual signal name is:

signal_list = {'log_data.subsystem_name.Data(:,1)'}
The syntax for a list of signal names is:
signal_list = {'log_data.block_name.Data(:,1)',...
               'log_data.block_name.Data(:,2)',...
               'log_data.block_name.Data(:,3)',...
               'log_data.block_name.Data(:,4)'};
If a component of your model contains a space or newline character, MATLAB® adds parentheses and a single quote to the name of the component. For example, if a section of the signal has a space, 'block name', MATLAB displays the signal name as:
log_data.('block name').Data(:,1)
To use the signal name as input to a CGV function, 'block name' must have two single quotes. For example:
signal_list = {'log_data.(''block name'').Data(:,1)'}

Output Arguments

Depending on the data, one or more of the following parameters might be empty:

signal_names

Cell array of signal names

signal_figures

Array of figure handles for signals