Plot a PWM Signal

19 Ansichten (letzte 30 Tage)
Muhammad Fattah Al Fattika
Muhammad Fattah Al Fattika am 18 Jun. 2020
Kommentiert: Ameer Hamza am 18 Jun. 2020
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.

Antworten (1)

Ameer Hamza
Ameer Hamza am 18 Jun. 2020
Bearbeitet: Ameer Hamza am 18 Jun. 2020
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 Kommentare
Muhammad Fattah Al Fattika
Muhammad Fattah Al Fattika am 18 Jun. 2020
It works. Thank you Ameer
Ameer Hamza
Ameer Hamza am 18 Jun. 2020
I am glad to be of help!!!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by