How to suppress warnings from fsolve method?

Hello,
how to suppress these kind of warnings for the fsolve method? It is orange by the way.
Warning: Trust-region-dogleg algorithm of FSOLVE cannot handle non-square systems; using Levenberg-Marquardt algorithm instead.
> In fsolve (line 298)
In function1 (line 24)
In mainScript (line 265)
Thank you!

Respuestas (2)

Jan
Jan el 9 de Mayo de 2017
Editada: Jan el 9 de Mayo de 2017

0 votos

The message means, that the default choise of the Trust-region-dogleg method is not suffcient.
The best way to suppress a warning is to fix the reason. If you know in advance, that you need a Levenberg-Marquardt algorithm, enable it explicitely instead of letting fsolve examine the problem by its own. See https://www.mathworks.com/help/optim/ug/fsolve.html#inputarg_options .

5 comentarios

Manuela Gräfe
Manuela Gräfe el 9 de Mayo de 2017
Actually I know what I am doing and the warning isn't interesting to me. I was just wondering if it's possible to suppress it.
As Jan suggests, enable the algorithm explicitly:
options = optimoptions('fsolve','Algorithm','levenberg-marquardt');
x = fsolve(fun,x0,options)
Best wishes
Torsten.
Manuela Gräfe
Manuela Gräfe el 9 de Mayo de 2017
Hi Torsten, yes, thank you. I understand Jan's and yours suggestion. But that's not what I am exactly looking for. Is it possible to mute warnings from fsolve in general?
Walter Roberson
Walter Roberson el 9 de Mayo de 2017
What benefit is being derived from not passing in the Algorithm option?
Jan
Jan el 10 de Mayo de 2017
@Manuela: It is possible to suppress warning messages, see doc warning . But it is a bad idea to ignore warnings. Even if you now know, what you are doing, your program might change in the future. Your data might be delivered as square matrix by accident and then a completely different solver is used. This might have unexpected consequences.

Iniciar sesión para comentar.

Alan Weiss
Alan Weiss el 9 de Mayo de 2017

0 votos

Sounds like you are interested in learning how to suppress warnings.
Alan Weiss
MATLAB mathematical toolbox documentation

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 9 de Mayo de 2017

Comentada:

Jan
el 10 de Mayo de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by