how to write a while-loop for a function
5 ビュー (過去 30 日間)
古いコメントを表示
lim x-> inf (1 + 1/x)^x how to write a while-loop that repeats it self until the value of the subsequent numbers are less than 10^(-6)
0 件のコメント
回答 (1 件)
Doug Hull
2012 年 10 月 10 日
flagMetTolerance = false
while ~flagMetTolerance
doMath
flagMetTolerance = (error <= tolerance)
end
2 件のコメント
Jan
2012 年 10 月 10 日
@Martin: Doug's program does the following: It is a while-loop, which calls the operation "doMath" repeatedly until a certain error value (the difference of subsequent elements in your case) is below the limit "tolerance".
I'm sure you will find out more details, if you are trying to use Matlab.
参考
カテゴリ
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!