how do i plot this waves ?

5 次查看(过去 30 天)
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 ! :)

采纳的回答

Birdman
Birdman 2017-11-3
编辑:Birdman 2017-11-3
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by