getSignals
Description
creates an interface to each signal saved in an MLDATX file. sigSubset = getSignals(mldatxFileObj)
getSignals returns an array of mldatx.io.Signal
objects where each mldatx.io.Signal object acts as an interface to a signal
in the MLDATX file referenced by the mldatx.io.File
object mldatxFileObj.
creates an interface to a subset of signals that match the filter options specified by the
name-value arguments. sigSubset = getSignals(mldatxFileObj,Name=Value)
Examples
Create an mldatx.io.File object referencing a saved
MLDATX file. The mldatx.io.File object is an interface to the MLDATX file
as a whole.
myFileObj = mldatxfile("MyFile.mldatx");You can also create a separate interface for each signal in an MLDATX file. To
create an array of mldatx.io.Signal objects that each reference a
signal in the MLDATX file, use the mldatx.io.File object as input to
the getSignals function.
allSigs = getSignals(myFileObj); allSigs.Name
ans =
'sineSig'
ans =
'rampSig'
ans =
'constSig'
Create an mldatx.io.File object referencing a saved MLDATX
file.
myFileObj = mldatxfile("MyFile.mldatx");Create an interface to the signals in the MLDATX file with names that contain
mysig. By default, results are case-insensitive and need not be the
whole word.
mySigs = getSignals(myFileObj,Name="mysig");
mySigs.Nameans =
'mysig'
ans =
'mysignal'
ans =
'mySig1'
ans =
'mySignal'To filter signals with whole-word or case-sensitive matching, use the
WholeWord or MatchCase name-value arguments. For
example, filter the results to include only the signals with matching
capitalization.
mySigsCaseMatch = getSignals(myFileObj,Name="mysig",MatchCase=true);
mySigsCaseMatch.Nameans =
'mysig'
ans =
'mysignal'Create an mldatx.io.File object referencing a saved MLDATX
file.
myFileObj = mldatxfile("MyFile.mldatx");An MLDATX file can contain data from multiple simulation runs. Use the
RunIndex filter option to create an interface to only the signals
from a particular run. For example, return all the signals in the third run.
mySigsThirdRun = getSignals(myFileObj,RunIndex=3)
Create an mldatx.io.File object referencing a saved MLDATX
file.
myFileObj = mldatxfile("MyFile.mldatx");Simulink.sdi.Signal objects have metadata that specifies the
technique used to log the signal such as signal logging, Outport blocks,
or the Record block. You can filter signals in the MLDATX file based on
the logging origin. For example, return the signals in the MLDATX file that were logged
using the Record block.
mySigs = getSignals(myFileObj,Domain="Record")Create an mldatx.io.File object referencing a saved MLDATX
file.
myFileObj = mldatxfile("MyFile.mldatx");You can get an interface to subset of signals connected to a specific block using
the block path. For example, get an interface to the signals connected to the output
port of the Playback block in the model myModel.
mySigsPlayback = getSignals(myFileObj,BlockPath="myModel/Playback");
You can combine the BlockPath filter option with the
SubPath and PortIndex filters. For example, get
an interface to the signal connected to the second port of the Playback block.
mySigPlayback2 = getSignals(myFileObj,BlockPath="myModel/Playback",PortIndex=2);
Input Arguments
Reference to MLDATX file that contains the signals to filter, specified as an
mldatx.io.File object.
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: mySigsThirdRun =
getSignals(myFileObj,RunIndex=3)
Filter Options
Signal name to filter by, specified as a string or character vector.
The Name filter option can be combined only with the
RunIndex filter option and the signal name search options
MatchCase and WholeWord.
By default, when you use the Name option, the subset of
filtered signals includes all signals with partially matching names, regardless of
case.
filteredSigs = getSignals(mldatxFileObject,Name="mysig");
filteredSigs.Nameans =
'mysig'
ans =
'mysignal'
ans =
'mySig1'
ans =
'mySignal'
To filter by whole names or matching capitalization, also include the
WholeWord or MatchCase name-value arguments.
filteredSigs = getSignals(mldatxFileObject,Name="mysig",WholeWord=true);
>> filteredSigs.Nameans =
'mysig'Example: filteredSigs =
getSignals(myFileObj,Name="mySigName",MatchCase=true,WholeWord=true)
Logging domain of signal to filter by, specified as a string or character vector such as one of these options:
"Signals"— Signal logging data"Outports"— Output logging data"States"— States logging data"Data Store Memory"— Data store memory logging data"Parameters"— Logged parameter data"Stateflow"— Stateflow® data"Simscape"— Simscape™ data"Assessments"— Simulink® Test™ assessment data"Profiling"— Execution profiling data
The Domain filter option can be combined only with the
RunIndex filter option.
Block path of logged signal, specified as a string or character vector.
The BlockPath filter option can be combined with the
SubPath, PortIndex, and
RunIndex filter options.
Component of block containing logged data, specified as a string or character
vector. For example, if the block path refers to a Stateflow chart, you can use SubPath to filter results by chart
signals.
The SubPath filter option can be combined with the
BlockPath, PortIndex, and
RunIndex filter options.
Output port index of logged signal, specified as a positive integer.
The PortIndex filter option can be combined with the
BlockPath, SubPath, and
RunIndex filter options.
Index of run that contains the logged signal, specified as a positive integer.
The RunIndex filter option can be combined with all other
filter options.
Signal Name Search Options
Option to return only case-sensitive matches, specified as true
or false.
This name-value argument can be used only in combination with the
Name, BlockPath, and
SubPath filter options.
Example: filteredSigs =
getSignals(myFileObj,Name="mySigName",MatchCase=true)
Option to return only whole word matches, specified as true or
false.
This name-value argument can be used only in combination with the
Name, BlockPath, and
SubPath filter options.
Example: filteredSigs =
getSignals(myFileObj,Name="mySigName",WholeWord=true)
Output Arguments
Interface to subset of signals saved in an MLDATX file, returned as an
mldatx.io.Signal object or an array of
mldatx.io.Signal objects.
Version History
Introduced in R2026a
See Also
Functions
Objects
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)