
Plot a PWM Signal
22 ビュー (過去 30 日間)
古いコメントを表示
Hello my name is Fattah, i am new in Matlab.
Can anybody here do me a favor? I want to plot a PWM Signal that have frequency = 490 Hz, Amplitude = 0 - 5, and Duty Cycle 50%. I've already try this : https://www.mathworks.com/help/signal/ref/square.html, but i have no idea how to set the frequency and the amplitude.
Thank you.
0 件のコメント
回答 (1 件)
Ameer Hamza
2020 年 6 月 18 日
編集済み: Ameer Hamza
2020 年 6 月 18 日
Try this
f = 490;
A = 5;
t = linspace(0, 0.01, 10000);
y = A*square(2*pi*f*t);
plot(t, y)
xlabel('time');
ylabel('Amplitude');

4 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!