Looping until threshold is met
显示 更早的评论
采纳的回答
更多回答(1 个)
KALYAN ACHARJYA
2021-1-20
0 个投票
You have to initialize "error" before the loop. The initial value must be less than a threshold value as defined. Also make sure that the error value is continuously increasing as the iteration progress, so that it definitely break loop condition.
2 个评论
AD
2021-1-20
KALYAN ACHARJYA
2021-1-20
Just make sure it will, otherwise, while loop runs continuously. You may check the code with sample 2/3 iteration manually.
error=abs(av_temp_simp13(iter)-av_temp_matlab);
类别
在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!