Warning using fmincon function.

Hello! I get the following warning using the function fmincon: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 6.286202e-18. What can be the cause? Thanks!

1 commentaire

Walter Roberson
Walter Roberson le 7 Juin 2017
We need to see your code. Are you using inv() or / (not ./ but /) or \ operators?

Réponses (1)

John D'Errico
John D'Errico le 7 Juin 2017
Modifié(e) : John D'Errico le 7 Juin 2017

0 votes

No need to have used inv - fmincon will call backslash on its own. Therefor, if you see a singular matrix indication while using fmincon, fmincon probably generated it.
This is probably an indication that fmincon has gotten into trouble, that your problem is either poorly defined, or the problem itself is ill-posed, or terribly poorly scaled, or the starting values provided have gotten fmincon to a bad place, or fmincon might be diverging. Which of those it is, we cannot tell. Or it might be something else I did not think to add to that list.
It MIGHT help to see the code you are using, as well as any data. Well, it cannot hurt to see that information, as we might be able to then diagnose the issue.

Cette question est clôturée.

Question posée :

le 6 Juin 2017

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by