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

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.

 채택된 답변

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);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

질문:

2013년 9월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by