Borrar filtros
Borrar filtros

funtion don't run

1 visualización (últimos 30 días)
Duong Cong  Bien
Duong Cong Bien el 25 de Nov. de 2015
Comentada: dpb el 25 de Nov. de 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 comentario
dpb
dpb el 25 de Nov. de 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?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by