NONLCON must be a function using lsqnonlin

조회 수: 7 (최근 30일)
James99
James99 2023년 8월 27일
댓글: James99 2023년 8월 28일
Hello everyone!
I am trying to estimate parameters using lsqnonlin and I get the following error:
Error using cnls
NONLCON must be a function
Error in lsqnonlin (line 220)
[xCurrent,Resnorm,FVAL,EXITFLAG,OUTPUT,LAMBDA,JACOB] = cnls(caller, FUN,xCurrent,A,B,Aeq,Beq,LB,UB,NONLCON, ...
I have no nonlinear constraints and therefore I left NONLCON as empty square brackets. I don't understand where I am going wrong.
The error occurs on line 70.

채택된 답변

Matt J
Matt J 2023년 8월 27일
편집: Matt J 2023년 8월 27일
No, you have set the nonlcon argument to Cexp which is a numeric vector. You should review the documentation for the correct ordering if the arguments.
  댓글 수: 6
Matt J
Matt J 2023년 8월 28일
If the optimization time is long, it doesn't necessarily mean you have slow convergence. If one execution of resfun takes a long time, that will also make the optimization time longer.
James99
James99 2023년 8월 28일
Right, but the warnings about not reaching the solution without reducing the time step below a permitted value a part of the process? I noticed that MATLAB continues with the calculation despite of these warnings. I suppose it does that particular iteration with smallest permitted time step value.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by