Looping until threshold is met
Ältere Kommentare anzeigen
Akzeptierte Antwort
Weitere Antworten (1)
KALYAN ACHARJYA
am 20 Jan. 2021
0 Stimmen
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 Kommentare
AD
am 20 Jan. 2021
KALYAN ACHARJYA
am 20 Jan. 2021
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);
Kategorien
Mehr zu Numerical Integration and Differential Equations finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!