Moving from nlinfit to lsqnonlin?
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to estimate the parameters of a nonlinear model. Using nlinfit so far works, and makes sense to me. I use it in the following way:
b=nlinfit(x_data,y_data,@my_model,initial_guess);
However, I want to add constraints to the parameters I'm estimating, which is why I'm trying to switch to lsqnonlin. I'm having a hard time translating my problem to this function though. After looking at the documentation, I can't see how I can pass the x and y data using this function. I literally just need what nlinfit does except with constraints to the parameters. Do I need to somehow make the "my_model" function accept the x and y data instead? Any help would be appreciated.
댓글 수: 1
답변 (1개)
Sean de Wolski
2016년 2월 25일
lsqcurvefit is essentially the same thing as lsqnonlin but accepts data and functions in the same manner you're used to.
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!