Why does my function give no outputs?
13 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2016-1-25
编辑:Walter Roberson
2016-1-25
If the condition is immediately false you never assign to A.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!