Why does my function give no outputs?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Joshua Hall
il 25 Gen 2016
Commentato: Walter Roberson
il 25 Gen 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 Commenti
Risposta accettata
Walter Roberson
il 25 Gen 2016
Modificato: Walter Roberson
il 25 Gen 2016
If the condition is immediately false you never assign to A.
2 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!