MATLAB: How to plot PWM signal with specific duty cycle and frequency

MATLABsignal processing

Is there any way of plotting a PWM signal when the duty cycle and the frequency is known ?

Best Answer

The following answer explains how to generate a square wave in Matlab with frequency,​amplitude,​voltage offset, and duty cycle. The parameter offset can be ignored for your case.