> 其他 >
2.如何用matlab 根据y=1+1/3+1/5+L +1/(2n-1),求(1)y
人气:438 ℃ 时间:2020-04-08 14:51:22
解答
function [Y,N] = qiumin
for n = 1:10000
y=f(n);
if y>3
N = n;
Y = y;
return;
end
end
function y = f(n)
y=0;
for i = 1:n
y = y+1/(2*i-1);
end
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版