Main Content

sltest.observer.addObserverReference

Add Observer Reference block to top level of model

Since R2024b

    Description

    obsref = sltest.observer.addObserverReference(sysmodel) adds an Observer Reference block to the top level of the system model, creates an Observer model, links the Observer Reference block to the Observer model, and returns a handle to the Observer Reference block.

    example

    Examples

    collapse all

    Open the sf_car model and add an Observer Reference block to the top level of the model. Adding an Observer Reference block to a model creates and opens a new Observer model. This example requires a Stateflow® license.

    import sltest.observer.*
    openExample("sf_car")
    
    mdlHandle= get_param(gcs,"Handle");
    obsref = addObserverReference(mdlHandle);

    Input Arguments

    collapse all

    System model to which to add an Observer Reference block, specified as a string or character vector that contains a model name, or a double data type model handle.

    Output Arguments

    collapse all

    Observer Reference block handle, returned as a double.

    Version History

    Introduced in R2024b