Reputation: 1708
Consider the block Manual switch
in Simulink. It enables you to switch manually between two inputs. If you have, more than two inputs, a natural thing to do is to construct a cascade as shown in this picture.
Is there an alternative in case of many inputs, such as one manual switch with n inputs?
Note that I was wondering whether there was a 'manual' way to do this. An alternative would be to use a multiport switch and set it with an initialisation script.
Upvotes: 2
Views: 10626
Reputation: 46
A Manual Variant Source can be used. You can edit mask parameters to specify the number of inputs
Upvotes: 2
Reputation: 351
Adding to the accepted answer, I achieved it using a Multiport Switch and a Rotary Switch.
Upvotes: 1
Reputation: 371
One way to approach this would be to use a Multiport Switch. This allows you to switch between several outputs based on the value of the first input (which you can tie to a constant block).
This way, when you start a simulation, you can choose the desired input by changing the value of the constant block in your model.
Mathworks Multiport Switch Help
Upvotes: 1