Professional Documents
Culture Documents
2)
x=linspace(0,2*pi,300);
y=sin(x);
z=sin(x+pi/3);
3)
x = 0:0.1:100;
y = 3*x;
plot(x,y)
4)
x = linspace(0,2*pi,50);
y = sin(x);
z = cos(x);
plot(x,y,'r', x,z,'gx')
5)
x = linspace(0,2*pi,50);
y = sin(x);
z = cos(x);
w = tan(x);
subplot(2,2,1)
plot(x,y)
subplot(2,2,2)
plot(x,z)
subplot(2,2,3)
plot(x,w)
6)
t=linspace(-10,10,1000)
u=heaviside(t)
plot(t,u)
8)
t1=linspace(-10,10,1000)
u2=(t1+1).*heaviside(t1+1)
plot(t1,u2
9)
t=0:0.01:5;
y=exp(5*t)-1;
plot(t,y)
10)
n=1:11;
bn=(-1).^n*2./(n*pi);
stem(bn)
12)
t=0:0.1:6*pi;
x=sin(t);
y=cos(t);
z=0.2*t;
plot3(x,y,z,'b')
grid on
xlabel('x'); ylabel('y'); zlabel('z')