funtion don't run

1 次查看(过去 30 天)
Duong Cong  Bien
Duong Cong Bien 2015-11-25
评论: dpb 2015-11-25
F=[];
A=[];
m=5;
sum=0;
for n=100:100:2000
for f=1:1:n
for i=0:1:f
p=exp(-(n-m-1)/f);
sum=sum+(factorial(f)/(factorial(i)*factorial(f-i)))*p^i*(1-p)^(f-i)*(1-i/f)^(m+1);
if sum<0,05;
F=[F i];
end
end
Fm=min(F)
end
A=[A Fm];
end
  1 个评论
dpb
dpb 2015-11-25
>> factorial(170)
ans =
7.2574e+306
>> factorial(171)
ans =
Inf
>>
In short, "no can do" to evaluate limits via floating point artithmetic; you'll have to approach this in a different manner entirely.
What's the actual problem to be solved?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by