Why does the fmincon optimization give a slightly different solution in MATLAB 2019B as compared to 2020B?

2 views (last 30 days)
Pratik Khare
Pratik Khare on 18 Oct 2021
Answered: Alan Weiss on 19 Oct 2021
I have noticed that I get a different solution when using the fmincon function as compared to my colleague (he has 2019B and I have 2020B). We ran the exact same code, with the same initial conditions and constraints.
Do optimizers like lsqlin or fmincon have different optimization routines based on the MATLAB version?

Answers (1)

Alan Weiss
Alan Weiss on 19 Oct 2021
Many things change in each version. The usual issue is that the underlying math libraries can have slight differences. Optimization routines iterate, and these minute differences can be amplified. You might also notice slight differences when running the same routines and versions on different hardware.
Alan Weiss
MATLAB mathematical toolbox documentation




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!