Why does my function give no outputs?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Joshua Hall
el 25 de En. de 2016
Comentada: Walter Roberson
el 25 de En. de 2016
function [A]=AccGold()
n = 4;
while Gold(n)-Gold(n-1) > 0.00000001
n = n+1;
A = Gold(n)
end
end
I want to find the first value of Gold(n)-Gold(n-1) such that it is < 0.0000001
0 comentarios
Respuesta aceptada
Walter Roberson
el 25 de En. de 2016
Editada: Walter Roberson
el 25 de En. de 2016
If the condition is immediately false you never assign to A.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!