Why matlab giving me same values too many times
Mostrar comentarios más antiguos
Ok my input function was
r=2;
x(1)=0.3;
N=100
for i=1:N
x(i+1)=r*x(i)*(1-x(i))
end
And, matlab calculated my answer but gave me the same x values for about 6 times. It's very annoying since I don't need the same x values over and over again. Please tell me how can I avoid that? Thanks.
2 comentarios
Azzi Abdelmalek
el 15 de Mzo. de 2014
What are you expecting?
Sam
el 15 de Mzo. de 2014
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 15 de Mzo. de 2014
MATLAB uses finite precision floating point binary numbers. After a few steps of the calculation, all of the answers are the same to within the limited precision. If you require increased precision then you will need to use something like the symbolic toolbox.
x(t) = -1/2*((2/5)^(2^(t-1))-1)
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!