- Use a Clock block to get the simulation time
- Use a Math Function block to get the modulo, so time wraps to zero for a new day
- Use an Interval Test block to check whether you are in the range 9 am - 3 pm
- Feed that logical signal to your switch


Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!