Main Content

Model, Block, and Port Callbacks

Execute code for modeling events such as opening a model


set_paramSet system and block parameter values
get_paramGet parameter names and values
getCallbackAnnotationGet annotation executing callback


Simulink.AnnotationCreate and specify properties of text, image, and area annotations

Examples and How To

  • Model Callbacks

    Specify MATLAB® code that executes at certain action points for models, for example after the model loads or when you save it.

  • Block Callbacks

    Set block callbacks that execute when blocks are loaded, opened, or edited.

  • Port Callbacks

    Set callbacks on input and output ports that execute every time the connectivity of these ports changes.

  • View and Trace Callbacks in Model

    You can view and trace all the callbacks executed in a model.