The ability to make the output of the Mux block be a single contiguous vectored variable is not available in Simulink.
To work around this issue, you can create a variable in contiguous memory by using the 'Signal Conversion' block just after the Mux block. This forces a copy of the signal to be made into contiguous memory, where the output signal of the 'Signal Conversion' block can be named and will appear appropriately in the generated code. The 'Signal Conversion' block should be set to contiguous copy with the 'override optimizations' flag checked.
Best Answer