实验六
1.
>> x=0:2*pi/100:2*pi;
>> y=[0.5+3.*sin(x)./(1+x.*x)].*cos(x);
>> plot(x,y)
2.
(1)>> x=0:2*pi/100:2*pi;
>> y1=x.*x;y2=cos(2*x);y3=y1.*y2;
>> plot(x,y1,'y-')
>> plot(x,y2,'k--')
>> plot(x,y3,'b.-')
(
2
)
x=0:2*pi/100:2*pi;
y1=x.*x;y2=cos(2*x);y3=y1.*y2;
subplot(1,3,1)
plot(x,y1,
'y-'
)
subplot(1,3,2)
plot(x,y2,
'k--'
)
subplot(1,3,3)
plot(x,y3,
'b.-'
)
(
3
)
x=0:2*pi/100:2*pi;
y1=x.*x;y2=cos(2*x);y3=y1.*y2;
subplot(2,2,1);
bar(x,y1,
'y'
);
subplot(2,2,2);
stairs(x,y2,
'k'
);
subplot(2,2,3);
stem(x,y3,
'b'
);
subplot(2,2,4);
fill(x,y3,
'b'
);
3.
x=-5:0.1:5;
y=[];
for
x0=x
if
x0>=0
y=[y,(sqrt(pi)+x0)/exp(2)];
else
y=[y,log(x0+sqrt(1+x0*x0))];