Generating a square wave

3 次查看(过去 30 天)
Marcos García
Marcos García 2017-3-17
回答: Hildo 2017-3-18
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.

采纳的回答

Hildo
Hildo 2017-3-18
  1. Use the block "clock" that output to you the simulation time;
  2. 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;
  3. Use the "switch block" to check if is the first part (HIGH level) of the period (output 0 or 1).

更多回答(0 个)

类别

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