Main Content

sltest.observer.moveToObserver

Add block to Observer model

Since R2024b

    Description

    obsmodel= sltest.observer.moveToObserver(path) creates a new Observer model and moves the block located at path to the Observer model. The function also adds an Observer Reference block to the system model and configures the Observer Reference block.

    example

    obsmodel= moveToObserver(path,obsref) moves the block at the specified path to the Observer model associated with the specified Observer Reference block, obsref.

    Examples

    collapse all

    Move the Verification Subsystem1 subsystem in the slvnvdemo_powerwindow_vs model to an Observer model. The moveObserver function creates an slvnvdemo_powerwindow_vs_Observer1 Observer model. The Observer model that contains the moved subsystem and Observer Port blocks for each input to the subsystem. The function also adds an Observer Reference block to the slvnvdemo_powerwindow_vs model. This example requires a Simulink® Design Verifier™ license.

    import sltest.observer.*
    openExample("slvnvdemo_powerwindow_vs") 
    
    blockPath = Simulink.BlockPath...
       ({'slvnvdemo_powerwindow_vs/Verification Subsystem1'});
    obsModel = sltest.observer.moveToObserver(blockPath)
    

    Input Arguments

    collapse all

    Path of the block to move to the Observer Model, specified as a Simulink.BlockPath object. The specified block must have at least one input port and cannot have any output ports. You cannot move Outport, Goto, From, Data Store Write, or Data Store Memory blocks.

    Observer Reference block, specified as a string, character vector, or double. Use a string or character vector to specify the path of the Observer Reference block, or use a double to specify the handle of the Observer Reference block.

    Output Arguments

    collapse all

    Observer model, returned as a double data type model handle.

    Version History

    Introduced in R2024b