An interesting problem. I don't have a full solution, but I can poke around at the start of one. First of all, I should say that there are some pretty bizarre switch combinations possible. For example, suppose $S_{32}, S_{22},$ and $S_{21}$ were closed, but all others were open. That would put $V_2$ in parallel with $V_{3}$. You don't normally do that. Whichever battery is at the higher voltage would try to charge the other battery, and because there are no circuit protection devices present, there would be no current-limiting. You can get phenomenally high currents with batteries sometimes. They're "always on". The presence of switches $S_{11}$ and $S_{21}$ is presumably to allow $V_1$ alone to power $V_{\text{out}}$, or $V_2$ to do it alone. But they raise some weird possibilities. So, while there are technically $2^7=128$ possible switch combinations, I propose to analyze the circuit differently: from which batteries you're going to put in series to power the load (which is what I'll call $V_{\text{out}}$). In this case, there are $2^3=8$ possible combinations of batteries in series to power the load. The battery combinations are: none, $V_1, V_1+V_2, V_1+V_3, V_2, V_2+V_3, V_3, V_1+V_2+V_3$. Let $x$ in a switch's configuration mean "don't care". That is, we don't care if that switch is closed or open. Let $1$ mean that a switch is closed, and $0$ mean it is open. So then, if we want no batteries to power the load, we would have
$$
\begin{bmatrix}S_{11}\\S_{12}\\S_{13}\\S_{21}\\S_{22}\\S_{23}\\S_{32}\end{bmatrix}=
\begin{bmatrix}x\\0\\x\\x\\0\\x\\0\end{bmatrix}.$$
But note that we wouldn't want $S_{11}$ and $S_{13}$ both to be closed, because that would short out $V_2$ and cause a current spike that might even melt the wires. By the same token, we wouldn't want both $S_{21}$ and $S_{23}$ closed. These two constraints are going to be true for every configuration. In a real-world circuit, to be safer, you'd probably combine $S_{11}$ and $S_{13}$ into a single-pole, triple-throw switch in order to avoid this possibility. If we want $V_{\text{out}}=V_1$, then the necessary switch combination is
$$
\begin{bmatrix}S_{11}\\S_{12}\\S_{13}\\S_{21}\\S_{22}\\S_{23}\\S_{32}\end{bmatrix}=
\begin{bmatrix}1\\1\\0\\1\\0\\0\\0\end{bmatrix}.$$
If we want $V_{\text{out}}=V_1+V_2$, then the necessary switch combination is
$$
\begin{bmatrix}S_{11}\\S_{12}\\S_{13}\\S_{21}\\S_{22}\\S_{23}\\S_{32}\end{bmatrix}=
\begin{bmatrix}0\\1\\1\\1\\0\\0\\0\end{bmatrix}.$$
Can you see how to get the rest of the options?