MATLAB做如下题,晕了,要交作业。悬赏~各位神仙姐姐神仙哥哥~急求~~~~

2025-05-10 13:13:38
推荐回答(2个)
回答1:

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-')

回答2:

头晕,这么多年没看过这种题目了