MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   MATLAB论坛 (https://www.labfans.com/bbs/forumdisplay.php?f=6)
-   -   [MATLAB基础] 求e (https://www.labfans.com/bbs/showthread.php?t=14453)

飘过的风 2012-03-22 21:39

求e
 
建立m文件:function d=fun(n)
c=1;
d=0;
for b=1:n
c=c*b;
d=d+1/c;
end
然后输入fun(20)得不出正确答案。请问错在那里了?

lai 2012-03-23 20:45

回复: 求e
 
function d=fun(n)
c=1;
d=1;
for b=1:n
c=c*b;
d=d+1/c;
end

泰勒级数展开有问题


所有时间均为北京时间。现在的时间是 13:42

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.