- Use the block "clock" that output to you the simulation time;
- Get the rest of the division of this time by your period https://www.mathworks.com/matlabcentral/answers/7260-how-to-get-the-remainder-of-a-division-in-simulink;
- Use the "switch block" to check if is the first part (HIGH level) of the period (output 0 or 1).
Generating a square wave
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Marcos García
el 17 de Mzo. de 2017
Respondida: Hildo
el 18 de Mzo. de 2017
Hi...
I would like to know how to generate a square wave in Simulink with variable frequency, that is, I should be able to change the frequency of that square wave externally. The square wave generator from the Simulink library is not useful for my purpose.
Regards.
0 comentarios
Respuesta aceptada
Hildo
el 18 de Mzo. de 2017
0 comentarios
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!