how do i plot this waves ?

5 views (last 30 days)
almog atiya
almog atiya on 3 Nov 2017
Commented: Ahmed sazzad on 18 Oct 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 ! :)

Accepted Answer

Birdman
Birdman on 3 Nov 2017
Edited: Birdman on 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 Comment
Ahmed sazzad
Ahmed sazzad on 18 Oct 2020
squerwaves are not working correctly.

Sign in to comment.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!