1.
s(1)=1;
for n=2:100
s(n)=s(n-1)+1/n;
end
n=1:100;
plot(n,s(n),'b-')
hold on
x=0:0.1:100;
y1=x;
y2=sqrt(x);
y3=x.^(0.25);
plot(x,y1,'r',x,y2,'c',x,y3,'m')
hold off
2.
s(1)=1;
c(1)=s(1)-log(2);
for n=2:100
s(n)=s(n-1)+1/n;
c(n)=s(n)-log(n+1);
end
n=1:100
plot(n,c(n),'b-')
头晕,这么多年没看过这种题目了