Combine input lines into a scalar output line
Library
Signals & Systems
Description
The Merge block combines its inputs into a single output line whose value at any time is equal to the most recently computed output of its driving blocks. You can specify any number of inputs by setting the block's Number of Inputs parameter. All inputs must be the same width, for example, all scalar or all vectors of width three.You can specify an initial output value by setting the blocks Initial Output parameter. If you do not specify an initial output and one or more of the driving blocks do, the Merge block's initial output equals the most recently evaluated initial output of the driving blocks.
Merge blocks facilitate creation of alternately executing subsystems. See "Creating Alternately Executing Subsystems" on page 7-12 for an application example.
Simulink restricts the kinds of connections you can make to the inputs of a Merge block. In particular, it permits only connections that establish a one-to-one mapping from the outputs of nonvirtual blocks to the inputs of a Merge block. For example, you can use a Go To/From block pair to connect the scalar or vector output of a nonvirtual block in one part of a diagram to the input of a Merge block in another part of the diagram. The following diagram illustrates valid ways to connect nonvirtual blocks to a Merge block.

You cannot use a Merge block to connect multiple nonvirtual outputs to a single input on a Merge block. The following diagram illustrates invalid ways to connect nonvirtual blocks to a Merge block.

Simulink checks for invalid connections in a block diagram at the start of a simulation. If it detects an invalid connection, it stops and displays an error message.
Data Type Support
A Merge block accepts signals of any numeric type (complex or real) and data type, including user-defined types. If the input type is user-defined, the initial condition must be 0.
Parameters and Dialog Box

- Number of inputs
- The number of input ports to merge. Ports may be scalar or vector.
- Initial output
- Initial value of output. If unspecified, the initial output equals the initial output, if any, of one of the driving blocks.
Characteristics
Sample Time
|
Inherited from the driving block
|
Vectorized
|
Yes
|
Scalar Expansion
|
No
|
[ Previous | Help Desk | Next ]