Which of the following best explains why state machines complement Simulink models?
Think about how state machines organize behavior compared to continuous signal flow.
State machines provide a clear way to model discrete logic and mode changes, which complements Simulink's strength in continuous-time and data flow modeling.
Consider a state machine with two states: Idle and Active. It starts in Idle and switches to Active when input signal > 5. What is the output after input sequence [3, 6, 4]?
States: Idle (output=0), Active (output=1) Transitions: Idle -> Active if input > 5 Active -> Idle if input <= 5 Input sequence: 3, 6, 4
Check state changes at each input step based on the condition.
The machine starts in Idle (output 0). Input 3 keeps it Idle. Input 6 triggers transition to Active (output 1). Input 4 causes transition back to Idle (output 0).
When integrating a state machine with a Simulink model controlling a motor, which data output best represents the motor speed over time with states Off, Start, and Run?
States: Off (speed=0), Start (speed ramps 0 to 100), Run (speed=100) Input triggers: Start command at t=1s, Stop command at t=5s Simulation time: 0 to 6 seconds
Consider how speed changes during Start and Run states and stops after Stop command.
The motor speed is 0 initially (Off). At t=1s, Start ramps speed from 0 to 100 by t=3s. From t=3s to t=5s, Run maintains speed at 100. At t=5s, Stop command returns speed to 0.
Given a Simulink model with a state machine that never transitions from Init to Run state despite correct input, what is the most likely cause?
Think about comparing floating-point numbers in conditions.
Using '==' to compare floating-point values often fails due to precision issues. This prevents the transition condition from ever being true.
You need to design a state machine in Simulink to control a traffic light with states: Green, Yellow, and Red. Each state lasts a fixed time: Green 60s, Yellow 5s, Red 55s. Which approach correctly models the timing and transitions?
Think about how to measure time inside a state machine for fixed durations.
Using a timer variable that counts time spent in each state and triggers transitions when the duration is met is the correct way to model fixed-time traffic light states.
