Main Content


Determine if signal ID is valid

Since R2022b



    valid = Simulink.sdi.isValidSignalID(sigID) indicates whether sigID corresponds to a signal in the Simulation Data Inspector repository.


    collapse all

    You can use the Simulink.sdi.isValidSignalID function to check whether a signal ID is valid.

    Simulate the model sldemo_fuelsys to create a run in the Simulation Data Inspector.

    mdl = "sldemo_fuelsys";

    Use the Simulink.sdi.Run.getLatest function to access the latest run.

    fuelRun = Simulink.sdi.Run.getLatest;

    Get the signal ID for the first logged signal using the getSignalIDByIndex function.

    sigID = getSignalIDByIndex(fuelRun,1)
    sigID = int32

    Verify that the Simulation Data Inspector has a signal corresponding to the signal ID.

    ans = logical

    You can delete signals to clear out memory space or clean up the Simulation Data Inspector user interface.


    When you delete a signal, the signal ID becomes invalid.

    ans = logical

    Input Arguments

    collapse all

    Unique Simulation Data Inspector signal identifier, specified as a positive integer. The software creates a Simulink.sdi.Signal object for each signal you log in a model simulation or import into the Simulation Data Inspector. You can get the signal ID for a signal using getAllSignalIDs, getSignalIDsByName, or getSignalIDByIndex.

    Output Arguments

    collapse all

    Signal validity indicator, specified as a numeric or logical 1 (true) or 0 (false). When valid is true, the sigID is valid. When valid is false, the sigID is invalid.

    Version History

    Introduced in R2022b