Why are signal dimensions not calculated correctly when connecting the dynamically sized output from my C-MEX S-Function to a Demux block in Simulink?
I have a C-MEX S-Function that has a fixed input size of 1 and a dynamically sized output. I am connecting the output of my S-Function block to a Demux block. This is then connected to 3 other blocks, each expecting one input.
When I try to run my model I get the following error:
"Invalid setting for input port dimensions of Demux block 'selfcncall_test1/Demux'. The dimensions are being set to 1. This is not valid because the input has fewer elements than the total number of output ports of this block"
and the output of my C-MEX S-Function has dimension 1 instead of 3.
This does not happen with no input to the S-Function block, if my S-Function block input is dynamically sized, or if I connect the output of my S-Function block to any block other than a Mux/Demux.
Best Answer