Error using optimset(@lsqnonlin) matlab 2020b

Hi,
I'm having trouble using optimset () for lsqnonlin () function. I am using matlab version 2020b.
...
options = optimset(@lsqnonlin)
X = lsqnonlin('filtroRC', X0, [], [], options, Vin, t, Vout_e)
...
Error using optimset (line 163)
No default options available for the function 'lsqnonlin'.
I would appreciate suggestions

 채택된 답변

Walter Roberson
Walter Roberson 2020년 11월 30일
편집: Walter Roberson 2020년 11월 30일

1 개 추천

댓글 수: 5

Thank you very much for the answer, but even using the suggested function, it returns error. Instead of evaluation in matlab online it returns ok, I think the problem is the 2020b version of matlab that I use.
>> options = optimoptions(@lsqnonlin,'Algorithm','levenberg-marquardt',...
'MaxFunctionEvaluations',1500)
Error using optimoptions (line 124)
Invalid solver specified. Provide a solver name or handle (such as 'fmincon' or @fminunc).
Type DOC OPTIMOPTIONS for a list of solvers.
Obs: The first 2 examples of the suggested link, return ok too, both in matlab online and on my computer.
options = optimoptions ('fmincon')
and
options = optimoptions (@ fmincon, 'Algorithm', 'sqp', 'MaxIterations', 1500)
however, I appreciate any other suggestions!!
Ah... I suspect you do not have the Optimization Toolbox installed (or licensed perhaps.)
Juan Gómez
Juan Gómez 2020년 11월 30일
I installed the plugin, problem solved. Thanks a lot!!
Yi Zhao
Yi Zhao 2022년 4월 19일
Hello, Gómez. What is the plug-in you installed
Juan Gómez
Juan Gómez 2022년 4월 19일
Hi, was the Optimization Toolbox, just browse from matlab itself:
Add-Ons > Get Add-Ons > Optimization Toolbox

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2020년 11월 30일

댓글:

2022년 4월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by