Why does my function give no outputs?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Joshua Hall
am 25 Jan. 2016
Kommentiert: Walter Roberson
am 25 Jan. 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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 25 Jan. 2016
Bearbeitet: Walter Roberson
am 25 Jan. 2016
If the condition is immediately false you never assign to A.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!