You are on page 1of 1

C:\MATLAB6p5\work\LAB.

m
October 12, 2004
%sequare wave%
A=5;
w=40.*pi
rho=.6
t=0:.001:1
xa=A*square(w.*t,rho);
plot(t,xa);
%sawtooth wave%
A0=5;
w0=40.*pi
t0=0:.001:1
x0=A0*sawtooth(w0.*t0);
plot(t0,x0);
%sin & cos%
A=4
w0=2.*pi
phi=pi./6
t=-1:.01:1
cosine=A.*cos(w0.*t+phi)
sine=A.*sin(w0.*t+phi)
plot(t,cosine)
plot(t,sine)
%differential Equation%
t=0:.01:5
x=10.*(exp(-t))-5.*(exp(-(0.5*t)))
x1=10.*(exp(-t))+5.*(exp(-(0.5*t)))
plot(x,t)
plot(x1,t)
w=2.*pi*1000
t=-.002:.001:.002
B=20
phi=(pi./3)
a=500 %change it to 750 and 1000%
y=B.*sin(w.*t-phi).*exp(-a.*t)
plot(y,t)

Page 1
2:53:38 PM

You might also like