Main Content

Simulink.sdi.getSizeInfo

Get storage size of signals in Simulation Data Inspector

Since R2026a

    Description

    sizeInfo = Simulink.sdi.getSizeInfo(runID) returns a table of signal information, including storage size, for the signals in the run identified by runID.

    The signal storage size accounts for both the data and time vectors of a signal and can be affected by how time data is stored on disk.

    example

    sizeInfo = Simulink.sdi.getSizeInfo(runID,Name=Value) returns storage size information according to options specified by the name-value arguments. For example, to get a table showing the total size of signals logged from each domain, use the Domain="All" name-value argument.

    example

    Examples

    collapse all

    Display signal information for the most recent run in the Simulation Data Inspector. First, get the run ID for the most recent run.

    allRunIDs = Simulink.sdi.getAllRunIDs;
    runID = allRunIDs(end);

    Get the signal information, including approximate signal storage size, for that run.

    sigSizes = Simulink.sdi.getSizeInfo(runID)
    
    sigSizes =
    
      5×8 table
    
        Signal ID     Name           Size           Domain              Block Path             Port Index    Sample Time     NumPoints
        _________    _______    ______________    __________    ___________________________    __________    ____________    _________
    
           418       "rand2"    "808.00 Bytes"    "Outports"    "SignalSizes/Out1"                 1         "0.1"              101   
           422       "rand1"    "808.00 Bytes"    "Signals"     "SignalSizes/Random Number"        1         "0.1"              101   
           426       "sine1"    "1.58 KB"         "Record"      "SignalSizes/Record"               1         "Continuous"       101   
           430       "sine2"    "1.58 KB"         "Record"      "SignalSizes/Record"               2         "Continuous"       101   
           434       "sine3"    "1.58 KB"         "Record"      "SignalSizes/Record"               3         "Continuous"       101   
    
    

    Get the total storage size of data by logging domain. Get the run ID for the most recent run.

    allRunIDs = Simulink.sdi.getAllRunIDs;
    runID = allRunIDs(end);

    To get a table showing the signal sizes logged from one or more domains, use the Domain name-value argument. To display signal sizes as numerical values instead of strings, use the Format name-value argument and specify the units. For example, list the total size of logged data by domain in kilobytes.

    dataSizeByDomain = Simulink.sdi.getSizeInfo(runID,Domain="All",Format="KB")
    dataSizeByDomain =
    
      3×2 table
    
          Domain      Bytes (KB)
        __________    __________
    
        "Outports"     0.78906  
        "Record"        4.7344  
        "Signals"      0.78906  
    

    Input Arguments

    collapse all

    Run identifier, specified as a positive integer. The Simulation Data Inspector assigns a unique run ID for each run. You can get run IDs using Simulink.sdi.getAllRunIDs or Simulink.sdi.getRunIDByIndex.

    Example: sigSize = Simulink.sdi.getSizeInfo(17)

    Name-Value Arguments

    collapse 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: Simulink.sdi.getSizeInfo(runID,Domain="Signals",Format="MB")

    Logging domain for which to get the total signal storage size, specified as a string or character vector such as one of these options:

    • "All" — All logging domains

    • "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

    To get a table showing the total size of signals logged from each domain, use the Domain="All" name-value argument.

    To get a table of the signal sizes in a subset of domains, specify multiple domains in the name-value argument. For example, get a table that lists the total size of data logged using the Record and To Workspace blocks.

    dataSizes = Simulink.sdi.getSizeInfo(runID,Domain={"Record","To Workspace"})
    
    dataSizes =
    
      2×2 table
    
            Domain             Size     
        ______________    ______________
    
        "Record"          "816.00 Bytes"
        "To Workspace"    "816.00 Bytes"

    Example: Simulink.sdi.getSizeInfo(runID,Domain="Outports")

    Display format of units for size data, specified as one of these options:

    • "Auto" — Automatically adjust units based on data size

    • "Bytes" — Display units in bytes

    • "KB" — Display units in kilobytes

    • "MB" — Display units in megabytes

    • "GB" — Display units in gigabytes

    When Format="Auto", the Size column in the information table displays signal values as strings with the unit after each value. The units used for each signal or domain in the table depend on the size of the data.

    To display signal sizes as numerical values instead of strings, use the Format name-value argument and specify the units. When you specify the units, the software appends the units to the Size column title.

    sigSizes = Simulink.sdi.getSizeInfo(runID,Format="KB")
    sigSizes =
    
      5×8 table
    
        Signal ID     Name      Bytes (KB)      Domain              Block Path             Port Index    Sample Time     NumPoints
        _________    _______    __________    __________    ___________________________    __________    ____________    _________
    
           418       "rand2"     0.78906      "Outports"    "SignalSizes/Out1"                 1         "0.1"              101   
           422       "rand1"     0.78906      "Signals"     "SignalSizes/Random Number"        1         "0.1"              101   
           426       "sine1"      1.5781      "Record"      "SignalSizes/Record"               1         "Continuous"       101   
           430       "sine2"      1.5781      "Record"      "SignalSizes/Record"               2         "Continuous"       101   
           434       "sine3"      1.5781      "Record"      "SignalSizes/Record"               3         "Continuous"       101   
    

    Example: Simulink.sdi.getSizeInfo(runID,Format="MB")

    Output Arguments

    collapse all

    Table of signal information, including storage size, with these columns:

    • Signal ID — Signal identifier

    • Name — Signal name

    • Size — Approximate storage size of signal

    • Domain — Logging domain of signal

    • Block Path — Block path of signal

    • Port Index — Port index

    • Sample Time — Sample time

    • NumPoints — Number of data points in signal

    The Simulation Data Inspector assigns two signal IDs to each complex signal, one corresponding to the real part and the other for the imaginary part. In the signal information table, the software aligns storage size information with the signal ID corresponding to the real part of the signal.

    In the Simulation Data Inspector, hierarchical signals, such as buses or multidimensional signals, can be grouped by hierarchy under a spanning row in the signal table. The Simulation Data Inspector assigns a signal ID to these spanning signals, but does not store data in them.

    Version History

    Introduced in R2026a