Creating a Clock Generator in Simulink

10 次查看(过去 30 天)
Ta Wil
Ta Wil 2022-2-23
回答: Vidip 2023-11-23
Hello,
I need to input data to a chart. I would like the data to represent the hours of the day from 0 to 23 and for this to be a repeated sequence so that I can have a simulation time of two days. How do I start to create such a clock generator?
Thank you.

回答(1 个)

Vidip
Vidip 2023-11-23
I understand you want to create a clock generator that generates a periodic signal representing the hours of the day from 0 to 23, you can use the following steps:
  1. Use a 'Ramp block' in Simulink to generate a ramp signal with a period of 23 hours. This will represent the continuous progression of time within a day.
  2. You can use a 'Modulo block' to take the modulus of the ramp signal, effectively wrapping the signal back to 0 after it reaches 23. This will ensure that the signal remains within the desired range of 0 to 23.
  3. To quantize the Signal, use a 'Quantizer block' to quantize the modulated ramp signal to integers. This will convert the continuous time representation into discrete hours of the day, ranging from 0 to 23.
  4. Use a 'Delay block' with a delay time of 23 hours to delay the quantized signal by one day. This will effectively create a repeated sequence of the hourly values, allowing the simulation to run for two days.
For further information, refer to the documentation links below:

类别

Help CenterFile Exchange 中查找有关 Sources 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by