how do i plot this waves ?

3 Ansichten (letzte 30 Tage)
almog atiya
almog atiya am 3 Nov. 2017
Kommentiert: Ahmed sazzad am 18 Okt. 2020
hi im new in matlab and i need to plot the next waves and i have no idea how to start, i tried and the result didnt look good.
the waves :
1. sine wave, Vp=2V, f=1.5kHz, DC=0V
2. triangle wave, Vp=50mV, f=5kHz, DC=0V
3. square wave, Vptp=5V, f=12kHz, DC=2.5V
4. square wave, Vmin=0V, Vmax=5V, f=80kHz, duty cycle=75%
5. sawtooth wave, Vptp=5V, f=10kHz, DC= -3V
thank you for your help ! :)

Akzeptierte Antwort

Birdman
Birdman am 3 Nov. 2017
Bearbeitet: Birdman am 3 Nov. 2017
t=0:0.001:10;
%sine wave
sinewave=2*sin(1500*t);
%square wave Vptp=5v DC=2.5V
squarewave1=2.5+2.5*square(12000*t);
%triangle wave
trianglewave=0.25+0.25*sawtooth(5000*t);
%square wave f=80kHz
squarewave2=2.5+2.5*square(80000*t);
%sawtooth wave
sawtoothwave=-3+2.5*sawtooth(10000*t);
plot(t,sinewave)
%same plot command can be applied for any of them, get closer in figures to
%see the waves since their frequencies are high
If you want to see from a broader perspective, increase the increment of t, like 0.1.
  1 Kommentar
Ahmed sazzad
Ahmed sazzad am 18 Okt. 2020
squerwaves are not working correctly.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by