mldatx.io.Signal
Description
An mldatx.io.Signal object references the data and metadata for a
single signal stored in an MLDATX file. Use the mldatx.io.Signal object to
selectively inspect signal metadata and load data to the workspace.
Creation
To create an mldatx.io.Signal object:
Create an
mldatx.io.Fileobject using themldatxfilefunction. This object acts as an interface to the data in an MLDATX file.Create the
mldatx.io.Signalobject by using thegetSignalsfunction to select a specific signal from themldatx.io.Fileobject.
Properties
This property is read-only.
Name of the signal, represented as a character vector or a string. When the
mldatx.io.Signal object contains data logged from a simulation, the
Name property value matches the name specified for the signal in
the model. If the model does not specify the signal name, the Name
property value is the path to the block that produces the signal.
This property is read-only.
Index of the run in the referenced MLDATX file, represented as a positive integer.
This property is read-only.
Logging domain of the referenced signal, represented as a domain name such as one of these options:
'Signals'— Signal logging data or data not created by logging simulation data'Outports'— Output logging data'States'— States logging data'Data Store Memory'— Data store memory logging data'Parametrs'— Logged parameter data'Stateflow'— Stateflow® data'Simscape'— Simscape™ data'Assessments'— Simulink® Test™ assessment data'Profiling'— Execution profiling data
This property is read-only.
Signal description, represented as '', a character vector, or a
string. The Description property is populated in the
mldatx.io.Signal object if
You annotated the
Simulink.sdi.Signalobject before saving it to the MLDATX file.Simscape data was logged.
This property is read-only.
Units of saved signal data stored on disk, represented as a character vector or
string. For signals generated from simulating a model, the stored units of the
mldatx.io.Signal objects use the units specified in the model. If you
specified the display units for a Simulink.sdi.Signal object without
units, the display units set the stored units in the object. If you then save that
signal to an MLDATX file and create an mldatx.io.Signal object for the
signal, the StoredUnits property of the
mldatx.io.Signal object is set to the same display units.
This property is read-only.
Units used to display saved signal data in the Simulation Data Inspector, represented as a character vector or a string.
The display units for a signal may differ from the stored units that reflect the
data stored on disk. Suppose you specify the display units for a
Simulink.sdi.Signal object that has different units specified in the
model. If you then save that signal to an MLDATX file and create an
mldatx.io.Signal object for the signal, the
DisplayUnits property of the mldatx.io.Signal
object reflects your choice of display units, and the StoredUnits
property of the mldatx.io.Signal object is set to the units specified
in the model.
This property is read-only.
Data type for signal data, represented as a character vector.
This property is read-only.
Complexity of signal data, represented as 'real' or
'imaginary'.
This property is read-only.
Complex format used to display complex signal data in the Simulation Data Inspector, represented as one of these values:
'real-imaginary'— The real and imaginary components of the signal display together when you plot the signal. The imaginary component of the signal is plotted with a different shade of the Line Color value used to plot the real part of the signal.'magnitude'— The magnitude of the signal displays when you plot the signal.'magnitude-phase'— The magnitude and phase of the signal display together when you plot the signal. The phase is plotted with a different shade of the Line Color value used to plot the magnitude.'phase'— The phase of the signal displays when you plot the signal.
This property is read-only.
Signal sample time, represented as a character vector or string. A
SampleTime property value of 'Continuous'
indicates a variable-step simulation.
This property is read-only.
Name of the model that produced the signal, represented as a character vector. The
Model property is empty for Signal objects that contain data not
produced by simulating a model.
This property is read-only.
Block path for the block that produced the signal, represented as a character vector
or cell array. The BlockPath property value is a relative path that
does not include model hierarchy. The BlockPath property is empty
for Signal objects that contain data not produced by simulating a
model.
This property is read-only.
Component of the block, represented as a character vector that provides the block
path. For example, if the block path refers to a Stateflow chart, the BlockSubPath identifies a chart
signal.
This property is read-only.
Name of the block that produced the signal, returned as a character vector. The
BlockName property is empty for Signal objects
that contain data not produced by simulating a model.
This property is read-only.
Index of the output port connected to the signal on the block that produced the
signal, returned as a positive integer. The PortIndex property is
empty for Signal objects that contain data not produced by simulating a
model.
This property is read-only.
Signal dimensions, returned as an integer or integer array.
This property is read-only.
Index of the signal within a matrix representing a multidimensional signal, returned as an integer array.
This property is read-only.
Name of the high-level structure containing the imported signal, returned as a
character vector. The RootSource property only has value if the
Simulink.sdi.Signal object saved in the referenced MLDATX file was
imported rather than produced by simulating a model.
This property is read-only.
Path to the signal time data, returned as a character vector. The
TimeSource property only has value if the
Simulink.sdi.Signal object saved in the referenced MLDATX file was
imported.
This property is read-only.
Path to the signal sample values, returned as a character array. The
DataSource property only has value if the
Simulink.sdi.Signal object saved in the referenced MLDATX file was
imported.
Object Functions
load | Load data from MLDATX file to workspace |
Examples
Create an mldatx.io.File object referencing a saved MLDATX
file.
myFileObj = mldatxfile("MyFile.mldatx");Use the getSignals function to create an
mldatx.io.Signal object. For example, create an
mldatx.io.Signal object that contains the saved signal named
sineSig.
sig = getSignals(myFileObj,Name="sineSig")sig =
Signal with properties:
Name: 'sineSig'
RunIndex: 2
Domain: 'myModel/Record'
Description: ''
StoredUnits: ''
DisplayUnits: ''
DataType: 'double'
Complexity: 'real'
ComplexFormat: 'real-imaginary'
SampleTime: 'Continuous'
Model: 'myModel'
BlockPath: 'myModel/Record'
BlockSubPath: ''
BlockName: 'Record'
PortIndex: 1
Dimensions: 1
Channel: [1×0 int32]
RootSource: ''
TimeSource: ''
DataSource: ''
Load the signal data to the workspace in a
Simulink.SimulationData.Dataset object.
sigDataset = load(sig);
Version History
Introduced in R2026a
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)