plot
Description
plot(
plots the measured and
simulated voltage for all pulses inside the circuitModel
)ECM
object,
cicuitModel
. The ECM
object retains or saves a copy
of the pulse data which you can then use for comparison purposes. The function obtains the
simulated voltage by running a MATLAB®-based battery equivalent circuit model (ECM). This model is stored in the
simulateCurrentPulse
function of the ECM
object.
plot(
plots the measured and simulated voltage for the pulses inside the circuitModel
,pulseIds
)ECM
object, cicuitModel
, at the indices specified by
pulseIds
.
plot(___,
also
specifies options using one or more name-value arguments.Name=Value
)
returns a
chart
= plot(___)VoltageVerificationChart
object.
Examples
This example shows how to plot the measured and simulated voltage of
a specific pulse inside an ECM
object.
Open the DownloadBatteryData
example and load the required HPPC
data obtained for a BAK 2.9 Ah battery cell at 25 °C. This data consists of a table with
three columns. The columns of the table refer to time, voltage, and current values,
respectively.
openExample("simscapebattery/DownloadBatteryDataExample") load("testDataBAKcells/hppcDataBAKcell25degC.mat")
Store the HPPC data inside an HPPCTest
object by using the hppcTest
function. The HPPC data is a table,
so you must also specify each column name by using the TimeVariable
,
VoltageVariable
, and CurrentVariable
arguments.
These names must match the names of the columns in the hppcData
table.
hppcExp = hppcTest(hppcData,... TimeVariable="time (s)",... VoltageVariable="voltage (V)",... CurrentVariable="current (A)");
Fit the HPPC data in the hppcExp
object to a battery equivalent
circuit model (ECM). To fit the data and create an ECM
object, use the
fitECM
function.
batteryEcm = fitECM(hppcExp);
Analyze how the function performed the fit on the ECM for the fourth pulse in the
HPPC data by using the plot
function.
plot(batteryEcm,4)
Input Arguments
Equivalent circuit model used to plot the simulated voltage of a specific pulse,
specified as an ECM
object.
Indices of the tabulated pulse inside the ParameterSummary
property table of the ECM
object, specified as a nonnegative scalar or
vector of nonnegative values.
Data Types: double
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: plot(myTest,ChargePulseIndicesVisible="on")
Plot Arguments
Visibility of the simulation voltage, specified as
"off"
, "on"
, or as numeric or
logical 1
(true
) or 0
(false
). A value of "on"
is
equivalent to true
, and "off"
is
equivalent to false
. Thus, you can use the value of this
property as a logical value. The value is stored as an on/off logical value of type
matlab.lang.OnOffSwitchState
.
Visibility of the chart axes, specified as "off"
,
"on"
, or as numeric or logical 1
(true
) or 0
(false
). A value of "on"
is
equivalent to true
, and "off"
is
equivalent to false
. Thus, you can use the value of this
property as a logical value. The value is stored as an on/off logical value of type
matlab.lang.OnOffSwitchState
.
Chart Container Arguments
Chart size and location, excluding the margins for decorations such as axis labels
and tick marks. Specify this property as a vector of form [left bottom width
height]
. The values are in the units specified by the
Units
property.
left
— Distance from the left edge of the parent container to the inner-left edge of the chart that excludes the margins. Typically, the parent container is a figure, panel, or tab.bottom
— Distance from the bottom edge of the parent container to the inner-bottom edge of the chart that excludes the margins.width
— Width of the chart, excluding the margins.height
— Height of the chart, excluding the margins.
Note
Setting this property has no effect when the parent of the chart is a
TiledChartLayout
.
Chart size and location, including the margins for decorations such as axis labels
and tick marks. Specify this property as a vector of form [left bottom width
height]
. The values are in the units specified by the
Units
property.
left
— Distance from the left edge of the parent container to the outer-left edge of the chart that includes the margins. Typically, the parent container is a figure, panel, or tab.bottom
— Distance from the bottom edge of the parent container to the outer-bottom edge of the chart that includes the margins.width
— Width of chart, including the margins.height
— Height of chart, including the margins.
Note
Setting this property has no effect when the parent of the chart is a
TiledChartLayout
.
Chart size and location, excluding the margins for decorations such as axis labels
and tick marks. Specify this property as a vector of form [left bottom width
height]
. This property is equivalent to the
InnerPosition
property.
Note
Setting this property has no effect when the parent of the chart is a
TiledChartLayout
.
Position property to hold constant when adding, removing, or changing decorations, specified as one of the following values:
'outerposition'
— TheOuterPosition
property remains constant when you add, remove, or change decorations such as a title or an axis label. If any positional adjustments are needed, MATLAB adjusts theInnerPosition
property.'innerposition'
— TheInnerPosition
property remains constant when you add, remove, or change decorations such as a title or an axis label. If any positional adjustments are needed, MATLAB adjusts theOuterPosition
property.
Position units, specified as a value from the following table. To change the
position of the chart in specific units, set the Units
property
before specifying the Position
property. If you specify the
Units
and Position
properties in a single
command (using name-value pairs), be sure to specify Units
before
Position
.
Units | Description |
---|---|
'normalized' (default) | Normalized with respect to the parent container, which is typically the
figure, panel, or tab. The lower left corner of the container maps to
(0,0) , and the upper right corner maps to
(1,1) . |
'inches' | Inches. |
'centimeters' | Centimeters. |
'characters' | Based on the default font of the graphics root object:
|
'points' | Typography points. One point equals 1/72 inch. |
'pixels' | Pixels. On Windows® and Macintosh systems, the size of a pixel is 1/96th of an inch. This size is independent of your system resolution. On Linux® systems, the size of a pixel is determined by your system resolution. |
Layout options, specified as a TiledChartLayoutOptions
object.
This property specifies options when an instance of your chart is a child of a tiled
chart layout. If the instance is not a child of a tiled chart layout (for example, it
is a child of a figure or panel), then this property is empty and has no effect.
Otherwise, you can position the chart within the layout by setting the
Tile
and TileSpan
properties on the
TiledChartLayoutOptions
object.
For example, this code places chart object c
into the third
tile of a tiled chart
layout.
c.Layout.Tile = 3;
To make the chart span multiple tiles, specify the TileSpan
property as a two-element vector. For example, this chart spans 2
rows and 3
columns of
tiles.
c.Layout.TileSpan = [2 3];
Note
Tiled chart layouts are not supported for the axes returned by the getAxes
method. Instead, you can place an instance of your chart into a tiled chart
layout.
State of visibility, specified as 'on'
or
'off'
, or as numeric or logical 1
(true
) or 0
(false
). A
value of 'on'
is equivalent to true
, and
'off'
is equivalent to false
. Thus, you can
use the value of this property as a logical value. The value is stored as an on/off
logical value of type matlab.lang.OnOffSwitchState
.
'on'
— Display the chart.'off'
— Hide the chart without deleting it. You still can access the properties of chart when it is not visible.
Parent container of the chart, specified as a Figure
,
Panel
, Tab
, or
TiledChartLayout
object.
Visibility of the chart object handle in its parent's list of children, specified as one of these values:
'on'
— Chart object handle is always visible.'off'
— Chart object handle is invisible at all times. This option is useful for preventing unintended changes to the chart by another function. To temporarily hide the handle during the execution of that function, set theHandleVisibility
to'off'
.'callback'
— Chart object handle is visible from within callbacks or functions invoked by callbacks, but not from within functions invoked from the command line. This option blocks access to the object in the Command Window, but it allows callback functions to access it.
If the object is not listed in the Children
property of the
chart's parent object, then functions that get object handles by searching the object
hierarchy or querying handle properties cannot return it. This includes get
, findobj
, gca
, gcf
, gco
, newplot
, cla
, clf
, and close
.
Hidden object handles are still valid. Set the root
ShowHiddenHandles
property to 'on'
to list
all object handles, regardless of their HandleVisibility
property
setting.
Output Arguments
Chart for visualizing the measured and simulated voltage in a voltage plot, returned
as a VoltageVerificationChart
object.
Version History
Introduced in R2025a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)