主要内容

listSignals

List signals in MLDATX file

Since R2026a

    Description

    sigList = listSignals(mldatxFileObj) lists the signals in the MLDATX file referenced by the mldatx.io.File object mldatxFileObj.

    example

    sigList = listSignals(mldatxFileObj,RunIndex=idx) lists the signals from the run specified by the run index idx.

    example

    Examples

    collapse all

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

    myFileObj = mldatxfile("MyFile.mldatx");

    Get a list of all signals in the referenced MLDATX file.

    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 also create a list of signals from only one run in the MLDATX file. For example, list the signals in the second run.

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

    Input Arguments

    collapse all

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

    Run index of the run that contains the signals to display in the table, specified as a positive integer.

    Output Arguments

    collapse all

    List of signals, returned as a table with these columns:

    • Name — Signal name

    • RunIndex — Run index

    • Domain — Domain of signal

    • BlockPath — Block path of signal

    • BlockSubPath — Block sub-path of signal

    • PortIndex — Port index

    For multidimensional and complex signals, the software lists the parent signal.

    For buses, nested buses, and arrays of buses, the signal list displays the leaves.

    Version History

    Introduced in R2026a