The mux block is not changing the values. In that sense, "Mux signals do not affect simulation or code generation."
But, as the documentation says, "The Mux block combines inputs with the same data type and complexity into a vector output."
If you never directly operate on that vector, the vector may not appear in the generated code. Your model is operating on the vector via the gain block, and the vector output from that gain block is written to a root level output port Out2. Keeping Out2 as a vector in the generated code is natural approach to handling all four values assigned to the port.