Main Content

Event Functions

Customize default model Initialize and terminate methods

Model dynamic startup and shutdown behavior by adding custom routines to the default model initialize and terminate methods. During simulation, control when the methods execute with events. Create functions to reinitialize blocks with initial values.

Blocks

expand all

Initialize FunctionExecute subsystem on model initialize event
Reinitialize FunctionExecute subsystem on model or subsystem reinitialize event (Since R2022a)
Reset FunctionExecute subsystem on model reset event
Terminate FunctionExecute subsystem on model terminate event
State ReaderRead a block state
State WriterWrite to a block state
Parameter WriterWrite to block parameter or variable
Data Store ReadRead data from data store
Data Store WriteWrite data to data store

Model Settings

Parameter Writer block validationGlobally or locally enable parameter validation (Since R2023a)

Topics