Bird
Raised Fist0
Simulinkdata~10 mins

Zero-order hold in Simulink - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Zero-order hold
Input Signal: Continuous
↓
Sample at fixed intervals
↓
Hold sampled value constant
↓
Output Signal: Piecewise constant
↓
Repeat for next sample
Zero-order hold samples a continuous signal at fixed times and holds each sample value constant until the next sample.
Execution Sample
Simulink
Input: sin(t) continuous signal
Sample time: 1 sec
Output: hold each sample value for 1 sec
Samples a sine wave every 1 second and holds the value constant until next sample.
Execution Table
StepTime (s)Input Signal ValueSampled ValueOutput ValueAction
10sin(0)=0.00.00.0Sample input and hold
20.5sin(0.5)=0.47940.00.0Hold previous sample
31sin(1)=0.84150.84150.8415Sample input and hold
41.5sin(1.5)=0.99750.84150.8415Hold previous sample
52sin(2)=0.90930.90930.9093Sample input and hold
62.5sin(2.5)=0.59850.90930.9093Hold previous sample
73sin(3)=0.14110.14110.1411Sample input and hold
83.5sin(3.5)=-0.35080.14110.1411Hold previous sample
94sin(4)=-0.7568-0.7568-0.7568Sample input and hold
104.5sin(4.5)=-0.9775-0.7568-0.7568Hold previous sample
115sin(5)=-0.9589-0.9589-0.9589Sample input and hold
125.5sin(5.5)=-0.7055-0.9589-0.9589Hold previous sample
136sin(6)=-0.2794-0.2794-0.2794Sample input and hold
146.5sin(6.5)=0.2151-0.2794-0.2794Hold previous sample
157sin(7)=0.65700.65700.6570Sample input and hold
167.5sin(7.5)=0.93790.65700.6570Hold previous sample
178sin(8)=0.98940.98940.9894Sample input and hold
188.5sin(8.5)=0.79850.98940.9894Hold previous sample
199sin(9)=0.41210.41210.4121Sample input and hold
209.5sin(9.5)=-0.07520.41210.4121Hold previous sample
2110sin(10)=-0.5440-0.5440-0.5440Sample input and hold
💡 Simulation ends at 10 seconds; last sample held until end.
Variable Tracker
VariableStartAfter 1After 2After 3After 4After 5After 6After 7After 8After 9After 10
Time (s)00.511.522.533.544.55
Input Signal Value0.00.47940.84150.99750.90930.59850.1411-0.3508-0.7568-0.9775-0.9589
Sampled Value0.00.00.84150.84150.90930.90930.14110.1411-0.7568-0.7568-0.9589
Output Value0.00.00.84150.84150.90930.90930.14110.1411-0.7568-0.7568-0.9589
Key Moments - 3 Insights
Why does the output value stay the same between sample times?
Because zero-order hold keeps the sampled value constant until the next sample, as shown in rows where output equals previous sampled value (e.g., step 2 holds 0.0 from step 1).
Is the output signal continuous or discrete?
The output is piecewise constant, not continuous; it changes only at sample times, holding values in between, as seen in the output column of the execution table.
Why do we sample the input at fixed intervals?
Sampling at fixed intervals allows the zero-order hold to update the output value regularly, creating a stepwise approximation of the input signal, as shown at steps 1,3,5,...
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table at step 4 (time 1.5s). What is the output value?
A0.9975
B0.8415
C0.0
D0.4794
💡 Hint
Check the 'Output Value' column at step 4 in the execution table.
At which step does the sampled value first become negative?
AStep 11
BStep 7
CStep 9
DStep 13
💡 Hint
Look at the 'Sampled Value' column in the execution table for negative values.
If the sample time was reduced to 0.5 seconds, how would the output values change?
AOutput would update twice as often, holding values for 0.5s each
BOutput would hold values longer, updating less often
COutput would become continuous
DOutput values would be the same but delayed
💡 Hint
Consider how sample time affects how often the zero-order hold updates output.
Concept Snapshot
Zero-order hold (ZOH):
- Samples continuous input at fixed intervals
- Holds each sample value constant until next sample
- Output is piecewise constant signal
- Used to convert continuous signals to discrete-time
- Sample time controls update frequency
- Common in digital control and simulation
Full Transcript
Zero-order hold takes a continuous signal and samples it at fixed times. Each sampled value is held constant until the next sample. This creates a stepwise output signal that approximates the input. For example, sampling a sine wave every 1 second and holding the value creates a piecewise constant output. The execution table shows time, input value, sampled value, and output value at each step. Between samples, the output holds the previous sample value. This method is common in digital control systems to convert continuous signals into discrete signals for processing.

Practice

(1/5)
1.

What is the main function of a Zero-order hold block in Simulink?

easy
A. It converts continuous signals to discrete signals.
B. It differentiates the input signal continuously.
C. It integrates the input signal over time.
D. It holds the input value constant between sample times.

Solution

  1. Step 1: Understand the role of Zero-order hold and compare options

    The Zero-order hold block keeps the input value constant during the sample period. It does not differentiate, integrate, or convert continuous to discrete signals.
  2. Final Answer:

    It holds the input value constant between sample times. -> Option D
  3. Quick Check:

    Zero-order hold = hold input constant [OK]
Hint: Remember: zero-order hold means 'hold value constant' [OK]
Common Mistakes:
  • Confusing zero-order hold with differentiation or integration
  • Thinking it converts continuous to discrete signals
  • Assuming it changes the signal value continuously
2.

Which of the following is the correct way to set the fixed sample time parameter in a Zero-order hold block in Simulink?

easy
A. Set sample time to a positive number like 0.1 seconds.
B. Set sample time to -1 for inherited sample time.
C. Set sample time to 0 for continuous operation.
D. Set sample time to a negative number other than -1.

Solution

  1. Step 1: Understand sample time settings and evaluate options

    Fixed sample time must be a positive number (e.g., 0.1s) to specify hold duration. -1 inherits from input; 0 means continuous (no hold); other negatives invalid.
  2. Final Answer:

    Set sample time to a positive number like 0.1 seconds. -> Option A
  3. Quick Check:

    Sample time positive number = correct setting [OK]
Hint: Sample time must be positive for zero-order hold [OK]
Common Mistakes:
  • Using zero or negative sample times incorrectly
  • Confusing inherited sample time (-1) with explicit sample time
  • Setting sample time to continuous (0) for discrete hold
3.

Consider this Simulink model snippet using a Zero-order hold block with sample time 0.5 seconds. The input signal is a step that changes from 0 to 1 at time 0.3 seconds. What will be the output of the Zero-order hold block at time 0.7 seconds?

medium
A. 0.5
B. 0
C. 1
D. Undefined

Solution

  1. Step 1: Analyze sample intervals and input timing

    With sample time 0.5s, samples at 0, 0.5, 1.0s. Step changes at 0.3s, so input(0)=0, input(0.5)=1. At 0.7s (in [0.5,1.0)), holds 1.
  2. Final Answer:

    1 -> Option C
  3. Quick Check:

    Output holds last sampled input = 1 [OK]
Hint: Output holds input at last sample time before current time [OK]
Common Mistakes:
  • Thinking sample at 0.5s captures 0 despite change at 0.3s
  • Ignoring sample time intervals
  • Confusing step change time with sample time
4.

In a Simulink model, a Zero-order hold block is set with sample time 0.2 seconds. The output signal is not holding values as expected and changes continuously. What is the most likely cause?

medium
A. Sample time is set to 0 (continuous) instead of 0.2.
B. Input signal is discrete, so hold is unnecessary.
C. Zero-order hold block is connected incorrectly.
D. Sample time is set to a negative number other than -1.

Solution

  1. Step 1: Identify cause of continuous output behavior

    If sample time=0, block operates continuously (follows input without holding). Other causes less likely to produce continuous change.
  2. Final Answer:

    Sample time is set to 0 (continuous) instead of 0.2. -> Option A
  3. Quick Check:

    Continuous sample time = no hold [OK]
Hint: Check sample time is positive, not zero [OK]
Common Mistakes:
  • Ignoring sample time setting
  • Assuming input signal type causes issue
  • Misconnecting blocks without checking parameters
5.

You want to convert a discrete sensor signal sampled every 0.1 seconds into a continuous signal for further processing in Simulink. Which approach using a Zero-order hold block is correct?

Choose the best option.

hard
A. Do not use Zero-order hold; use a continuous integrator instead.
B. Set the Zero-order hold sample time to 0.1 seconds to hold each sample value constant until the next sample.
C. Set the Zero-order hold sample time to -1 to inherit sample time from input.
D. Set the Zero-order hold sample time to 0 to make the output continuous.

Solution

  1. Step 1: Understand goal and evaluate ZOH configurations

    Goal: hold discrete samples constant between 0.1s intervals for continuous output. Set Ts=0.1s matches sensor rate. Ts=0 continuous (no hold); -1 inherits (risk mismatch); integrator changes values.
  2. Final Answer:

    Set the Zero-order hold sample time to 0.1 seconds to hold each sample value constant until the next sample. -> Option B
  3. Quick Check:

    Sample time = sensor rate for correct hold [OK]
Hint: Match hold sample time to sensor sample interval [OK]
Common Mistakes:
  • Setting sample time to zero for hold
  • Using inherited sample time without checking input
  • Replacing hold with integrator incorrectly
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard