メインコンテンツ

getAsDatastore

Create datastore for processing big data stored in MLDATX file

Since R2026a

    Description

    signalDS = getAsDatastore(mldatxFileObj,Name=Value) creates a datastore for interacting with data stored in the MLDATX file referenced by the mldatx.io.File object mldatxFileObj. Such a datastore lets you process data that is too large to fit in memory. You must specify a subset of signals using one or more filtering option name-value arguments.

    The getAsDatastore function supports scalar signals, complex signals, multidimensional signals, variable-size signals, and buses. The function returns a Simulink.SimulationData.Signal object that contains an MLDATXSignalDatastore object in its Values property. Use the MLDATXSignalDatastore object to examine, load, and process the selected data.

    example

    Examples

    collapse all

    Create an mldatx.io.File object referencing a saved MLDATX file.

    myFileObj = mldatxfile("MyFile.mldatx");

    Use the getAsDatastore function to create a Simulink.SimulationData.Signal object for the signal named mySig which is saved in the MLDATX file referenced by myFileObj. The MLDATXSignalDatastore object is stored in the Values property of the Signal object.

    mySigSignal = getAsDatastore(myFileObj,Name="mySig");
    mySigDatastore = mySigSignal.Values;

    You can use the datastore to incrementally load data from an MLDATX file that is too large to fit into memory at once. For more information, see Incrementally Read Data Too Large to Fit into Memory from MLDATX File to Workspace.

    Input Arguments

    collapse all

    Reference to MLDATX file that contains the signals to get as a datastore, specified as an mldatx.io.File object.

    Name-Value Arguments

    expand all

    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: mySigsThirdRunDS = getAsDatastore(myFileObj,RunIndex=3)

    Filter Options

    expand all

    Signal name to specify for datastore, 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 function exports all signals with partially matching names, regardless of case. To filter by whole names or matching capitalization, also include the WholeWord or MatchCase name-value arguments.

    Example: mySigDS = getAsDatastore(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, specified as a string or character vector. For example, if the block path refers to a Stateflow chart, you can use SubPath to indicate the 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

    expand all

    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 filter option.

    Example: mySigDS = getAsDatastore(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 filter option.

    Example: mySigDS = getAsDatastore(myFileObj,Name="mySigName",WholeWord=true)

    Output Arguments

    collapse all

    Datastore representation of an element from a referenced MLDATX file, returned as Simulink.SimulationData.Signal object or array of Simulink.SimulationData.Signal objects whose Values property contains the mldatx.io.datastore.MLDATXSignalDatastore object.

    Version History

    Introduced in R2026a