In the model above, the output will be 2 regardless of whether the switch is open or closed. This is caused by the fact that the switch is not actually completely open; rather, it still has some impedance that is specified by the open conductance in the block’s dialog.
To get behavior that is more indicative of the switch utility, you could use a switch to open or close a short circuit. The following model demonstrates how the switch can be used, and the circuit that it represents:
As illustrated in the screenshot above, the models on the left use a switch (threshold 3), while those on the right use resistors with resistances set to match the resistance/conductance specified for closed and open circuit values of the corresponding switch. In the top models, the switch is open -- represented on the left by a very high resistance. In the bottom case, the switch is closed, as represented on the right by a very low resistance. In both cases, the resistances on the right match those specified in the corresponding Switch Block parameters.