lsqcurvefit answer upon termination?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nicholas Ross
am 11 Mär. 2024
Kommentiert: Nicholas Ross
am 12 Mär. 2024
I'm curious about what answer lsqcurvefit is giving me when it terminates. When the program ends due to reaching number of iterations, does the answer (x) come from the last iteration or does it return the best answer based on previous iterations? By best I mean lowest first order optimality measure, step size, function tolerance size, etc.
2 Kommentare
Akzeptierte Antwort
Matt J
am 11 Mär. 2024
Bearbeitet: Matt J
am 11 Mär. 2024
You can use a nested OutputFcn, like in this example,
to save the entire iteration history of x and resnorm values. You can then retrospectively pick the solution that you want from the whole iteration sequence.
You could also modify this example to save only the best-so-far x vector, rather than the whole history.
5 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Systems of Nonlinear Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!