funtion don't run

1 Ansicht (letzte 30 Tage)
Duong Cong  Bien
Duong Cong Bien am 25 Nov. 2015
Kommentiert: dpb am 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 Kommentar
dpb
dpb am 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?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by