MATLAB: Is it possible to connect the input signal of the Merge block to other blocks in Simulink

blockconnectenhancementinputinvalidmergesignalssimulink

When I connect the input signal of a Merge block to another block, I receive the following error message:
The connection from block 'untitled/Constant' output port 1 to block 'untitled/Merge' input port 2 is
invalid, because the output signal is also driving the merge block 'untitled/Merge' input port 1.
Signals being merged can only be connected to a merge block input port, and should not be
connected to any other block input port

Best Answer

The ability to connect the input signal of a Merge block to another block is not available in Simulink.
To work around this issue, do the following:
1. Add an extra Gain (Gain=1) block or a Data Type Conversion block to the input signal of the MERGE block.
2. The input signal of the block you added in step 1 can be branched and connected to any other Simulink block.
Please note that adding a GAIN block to the input of the MERGE block may change its output. The value of the output at any time is equal to the most recently computed output of its driving blocks. Hence if a MERGE block has 3 inputs and a GAIN block is connected to each of them, then the output of the MERGE block will be equal to the output of the GAIN block appearing last in the sorted order. The reason for this is that the output of a GAIN block is computed at each step which may not be the case with conditionally executing subsystems.
Please see Technical Solution # 1-6J6U3Y for more details.