Main Content

Initialize Function

Executes contents on a model initialize event

  • Library:
  • Simulink / User-Defined Functions

  • Initialize Function block

Description

TheInitialize Functionblock is a pre-configured subsystem block that executes on a model initialize event. By default, theInitialize Functionblock includes anEvent Listenerblock withEventset toInitialize, aConstantblock withConstant valueset to0, and aState Writerblock.

Replace theConstantblock with blocks that generate the state value for theState Writerblock.

Conditionally executed subsystem blocks with output ports fully supported within Terminate Function blocks

For a list of unsupported blocks and features, seeInitialize, Reset, and Terminate Function Limitations.

The input and output ports of a component containing Initialize Function and Terminate Function blocks must connect to input and output port blocks.

The code generated from this block is part of themodel_initializefunction that is called once at the beginning of model execution.

Block Characteristics

Data Types

Boolean[a]|bus[a]|double[a]|enumerated[a]|fixed point[a]|half[a]|integer[a]|single[a]|string[a]

Direct Feedthrough

no

Multidimensional Signals

limited[a]

Variable-Size Signals

no

Zero-Crossing Detection

no

[a]Actual data type or capability support depends on block implementation.

Extended Capabilities