Professional Documents
Culture Documents
Lab#02 task1
x=-20:0.01:20
y=sin(x)./x
plot(x,y)
xlabel('x')
ylabel('sin(x)/x')
cosine function
x=-20:0.01:20
f=0.3
y=cos(2*pi*f*x)
plot(x,y)
xlabel('x')
ylabel('cos(2*pi*f*x)')
sine function
x=-20:0.01:20
f=0.3
y=sin(2*pi*f*x)
plot(x,y,'-')
xlabel('x')
ylabel('sin(2*pi*f*x)')
Task 2
x=1:100;
y=log(x)
z=sqrt(x)
plot(x,y,'r')
hold on
plot(x,z,'g')
xlabel('time')
ylabel('amplitude')
hold off
for texture
plot(x,y,'r+')
plot(x,z,'g*')
task 3
Subploting command
x=linspace (0,2*pi,50)
y=sin(x)
z=cos(x)
w=tan(x)
subplot 221
plot(x,y)
subplot 222
plot(x,z)
subplot 223
plot(x,w)