Hi,
You can get the desired output by using a pwm block in simulink and switch the input to it with a switch block.
An example model has been attached for reference.
Hope this helps !!
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!