主要内容

getRunInfoByIndex

Get detailed metadata for run in MLDATX file

Since R2026a

    Description

    runMetadata = getRunInfoByIndex(mldatxFileObj,idx) returns detailed metadata for the run at index idx in the MLDATX file referenced by the mldatx.io.File object mldatFileObj. This function is useful to get details on a particular run after reviewing high-level run information returned by listRuns.

    example

    Examples

    collapse all

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

    myFileObj = mldatxfile("MyFile.mldatx");

    Get a detailed metadata for a run saved in the MLDATX file. For example, get metadata for the run at index 2.

    runMetadata = getRunInfoByIndex(myFileObj,2)
    runMetadata = 
    
      struct with fields:
    
                       RunIndex: 2
                           Name: 'Run 2: myModel'
                         Status: 'ReachedStopTime'
                    Description: ''
                            Tag: ''
                    DateCreated: '19-Jun-2025 16:11:52'
                          Model: 'myModel'
                        SimMode: 'normal'
                      StartTime: 0
                       StopTime: 10
                      SLVersion: 'Simulink 25.2 (R2025b)'
                   ModelVersion: '1.1'
                         UserID: 'myusername'
                    MachineName: 'MYMACHINENAME'
                       Platform: 'PCWIN64'
                       TaskName: ''
                     SolverType: 'Variable-Step'
                     SolverName: 'VariableStepDiscrete'
                 SolverStepSize: '0.2'
        ModelInitializationTime: 0.1667
             ModelExecutionTime: 0.0668
           ModelTerminationTime: 0.0086
          ModelTotalElapsedTime: 0.2421
           StopEventDescription: 'Reached stop time of 10'
                StopEventSource: ''
                ExecutionErrors: ''
              ExecutionWarnings: ''
                     UserString: ''
    

    Input Arguments

    collapse all

    Reference to MLDATX file that contains run, specified as an mldatx.io.File object.

    Run index of the run to display metadata for, specified as a positive integer.

    Output Arguments

    collapse all

    Detailed run metadata, returned as a structure with these fields corresponding to the properties of the Simulink.sdi.Run object:

    • RunIndex — Index of run in the Simulation Data Inspector, returned as a positive integer.

    • Name — Run name, returned as a character vector.

    • Status — Simulation status, returned as a character vector.

    • Description — Run description, returned as a character vector.

    • Tag — Information tag, returned as a character vector.

    • DateCreated — Run creation timestamp, returned as a datetime object.

    • Model — Name of model, returned as a character vector.

    • SimMode — Simulation mode, returned as a character vector.

    • StartTime — Start time of run, returned as a scalar.

    • StopTime — Stop time of run, returned as a scalar.

    • SLVersion — Software version used for the model simulation that created the run, returned as a character vector.

    • ModelVersion — Version of the model simulated to create the run, returned as a character vector.

    • UserID — System account, returned as a character vector.

    • MachineName — Name of the machine used for simulation, returned as a character vector.

    • Platform — Operating system on the machine used for simulation, returned as a character vector.

    • TaskName — Task name, returned as a character vector.

    • SolverType — Type of solver used in the simulation, returned as 'Variable-Step' or 'Fixed-Step'.

    • SolverName — Name of the solver used in the simulation, returned as a character vector.

    • SolverStepSize — Solver step size used for simulation, returned as a character vector.

    • ModelInitializationTime — Model initialization time, returned as a scalar.

    • ModelExecutionTime — Simulation execution time, returned as a scalar.

    • ModelTerminationTime — Simulation termination time, returned as a scalar.

    • ModelTotalElapsedTime — Total simulation time, returned as a scalar.

    • StopEventDescription — Translated description of simulation stop, returned as a character vector.

    • StopEventSource — Block that issued the stop event, returned as a Simulink.SimulationData.BlockPath object.

    • ExecutionErrors — Errors that occurred during simulation, returned as a character vector.

    • ExecutionWarnings — Warnings that occurred during simulation, returned as a character vector.

    • UserString — User-specified string, returned as a character vector.

    Version History

    Introduced in R2026a