Creating a Clock Generator in Simulink
Afficher commentaires plus anciens
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.
Réponses (1)
Vidip
le 23 Nov 2023
0 votes
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:
- 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.
- 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.
- 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.
- 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:
Catégories
En savoir plus sur Sources dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!