Main Content

Simulink.sdi.isValidSignalID

R2026b

Determine if signal ID is valid

Since R2022b

    Description

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

    To access the ID for a signal, use getAllSignalIDs, getSignalIDByIndex, or getSignalIDsByName.

    example

    Examples

    collapse all

    Verify that a signal ID corresponds to a signal in the Simulation Data Inspector.

    valid = Simulink.sdi.isValidSignalID(sigID)
    valid = logical
       1

    When you delete a signal from the Simulation Data Inspector, the signal ID becomes invalid.

    Simulink.sdi.deleteSignal(sigID);
    notValid = Simulink.sdi.isValidSignalID(sigID)
    notValid = logical
       0

    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