Why does my function give no outputs?
10 ビュー (過去 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.
2 件のコメント
その他の回答 (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!