I have a set of data points [z,y] , and I want to fit a function with two parameters to this data. I have done this as follows:
f=@(p,q) p(1)*((p(2) + q.^1).^-1);
p=lsqcurvefit( f, [1.4,1], z,y, [0.5,0.5],[3,3]);
plot(z,y, z, f(p,z));
But I want the area under the curve in the interval [0 1] to be a total of 1. Is it possible to build this in as a condition?
Thank you!

 채택된 답변

Matt J
Matt J 2021년 9월 11일

0 개 추천

The area constraint is non-linear. You would have to use fmincon instead.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

제품

질문:

2021년 9월 11일

답변:

2021년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by