MATLAB: Am I getting unexpected output dimensions or errors when demuxing a vector using the Demux block in Simulink 7.4 (R2009b)

cascadedemuxdimensionmuxsignalsimulink

I am combining signals using a network of Mux blocks in Simulink 7.4 (R2009b). Now I need to demux the signals in the same order as I muxed them.
When I use Demux blocks with setting similar to the Mux blocks used to create the muxed signal, I receive the following error:
Invalid setting for input port dimensions of 'MuxWorkingModel_test/Demux2'. The dimensions are being set to 3. This is not valid because the total number of input and output elements are not the same
See attached model "MuxWorkingModel_test.mdl" for an example.

Best Answer

This is a limitation in Simulink 7.4 (R2009b) in the way it resolves inherited Ssignal dimensions.
When the Simulink engine does not resolve the dimension of the signals coming out of a network of Demux blocks, it is recommend to specify the dimention of each signal coming out of the Demux blocks. For example instead of specify "3" so specify that a Demux has 3 outputs, specify "[1 1 1]" to specify the dimensions of the three output ports. See attached model "MuxWorkingModel_fixed.mdl" for an implementation of this example.