script function pulse rectangle PWM with duty cycle in simulink

조회 수: 12 (최근 30일)
Julio Vela
Julio Vela 2020년 10월 14일
댓글: Julio Vela 2021년 2월 17일
I can't make the pulse width repeat in every time period. I just need that in the code
  댓글 수: 5
Julio Vela
Julio Vela 2021년 2월 12일
편집: Julio Vela 2021년 2월 12일
its easy translate:
function PWM = fcn(amplitude,duty_cycle,requency,clock)%generator PWM
% *** declaración de variables ***
periode=1/frequency;%periodo=period
iduty=duty_cycle/100;
ton=iduty*periode;
toff=periode-ton;
if ((mod((clockt),periode)<=(0)))
PWM=amplitude;
else
PWM=0;
end
end
Julio Vela
Julio Vela 2021년 2월 17일
i resolved the problem!!!
https://www.youtube.com/channel/UCN7owHyMvoT7I6dv2eah6dA/videos

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Pulse and Transition Metrics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by