funtion don't run

1 view (last 30 days)
Duong Cong  Bien
Duong Cong Bien on 25 Nov 2015
Commented: dpb on 25 Nov 2015
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 Comment
dpb
dpb on 25 Nov 2015
>> 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?

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!