主要内容

mldatx.io.File

Reference to runs in MLDATX file

Since R2026a

    Description

    An mldatx.io.File object references signal data and metadata for runs stored in an MLDATX file. Use the mldatx.io.File object to selectively inspect signal metadata and load data to the workspace.

    MLDATX files can be used to store different types of data such as Signal Analyzer sessions, Simulink® Test™ assessment data, or Simulation Data Inspector sessions. You can also configure a model to log simulation data directly to an MLDATX using the Log data to file configuration parameter. For more information about saving Simulation Data Inspector sessions, see Save and Share Simulation Data Inspector Data and Views.

    Creation

    Create an mldatx.io.File object using the mldatxfile function.

    Properties

    expand all

    This property is read-only.

    MLDATX file name, represented as a character vector.

    Example: 'TwoRuns.mldatx'

    This property is read-only.

    Path to MLDATX file, represented as a character vector.

    Example: 'C:\Users\jsmith\Documents\MATLAB\myFolder'

    This property is read-only.

    Description of data stored in MLDATX file, represented as a character vector. MLDATX files can store data for many different purposes, such as Simulation Data Inspector sessions, Signal Analyzer sessions, or Simulink test results.

    To get a description of the data stored in a particular MLDATX file, you can also use the matlabshared.mldatx.getDescription function.

    Example: 'Simulation Data Inspector Session'

    This property is read-only.

    Timestamp of last modification made to the MLDATX file, represented as a datetime object.

    Example: '19-Jun-2025 16:11:57'

    This property is read-only.

    MLDATX file version, represented as '1.0' or '2.0'.

    To query the version of an MLDATX file, you can also use the Simulink.sdi.getVersion function.

    Example: '2.0'

    This property is read-only.

    Compression type, returned as one of these options:

    • 'fastest' — Similar save speed to an uncompressed file, smaller file size

    • 'balanced' — Balance between file size and save speed

    • 'compact' — Smallest file size, slowest save speed

    • 'none' — Largest file size, fastest save speed

    Object Functions

    loadLoad data from MLDATX file to workspace
    getSignalsCreate an interface to individual signals saved in MLDATX file
    getAsDatastoreCreate datastore for processing big data stored in MLDATX file
    getRunCountGet number of runs in MLDATX file
    getRunInfoByIndexGet detailed metadata for run in MLDATX file
    listRunsList runs in MLDATX file
    listSignalsList signals in MLDATX file

    Examples

    collapse all

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

    myFileObj = mldatxfile("MyFile.mldatx");

    Get a list of all runs in the MLDATX file using the listRuns function.

    runList = listRuns(myFileObj)
    runList =
    
      2×4 table
    
        RunIndex          Name               DateCreated            Model  
        ________    ________________    ______________________    _________
    
           1        "Run 1: myModel"    "19-Jun-2025 16:11:32"    "myModel"
           2        "Run 2: myModel"    "19-Jun-2025 16:11:52"    "myModel"
    

    Get a list of all signals in the MLDATX file using the listSignals function.

    allSigsList = listSignals(myFileObj)
    allSigsList =
    
      3×6 table
    
          Name       RunIndex         Domain            BlockPath        BlockSubPath    PortIndex
        _________    ________    ________________    ________________    ____________    _________
    
        "rampSig"       1        "Outports"          "myModel/Out1"           ""             1    
        "sineSig"       2        "myModel/Record"    "myModel/Record"         ""             1    
        "rampSig"       2        "Outports"          "myModel/Out1"           ""             1    
    

    You can load a signal from this file to the workspace using load. If you want to load signals too large to fit in memory, use getAsDatastore.

    Version History

    Introduced in R2026a