In simulink, how to generate a square wave using an external source as frequency?

19 views (last 30 days)
I want to generate a square wave where frequency is coming from an external source. In simulink square wave block, frequency parameter is hard coded.

Accepted Answer

ES
ES on 3 Sep 2013
you can use a normal Pulse generator block in Simulink and use set_param command to set any of the parameters like Amplitude, Period, PulseWidth, PhaseDelay, SampleTime etc.
set_param('Pulse Generator Block','Period',12);

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!