Curve fitting with set area

1 visualización (últimos 30 días)
Ilse Beentjes
Ilse Beentjes el 11 de Sept. de 2021
Respondida: Matt J el 11 de Sept. de 2021
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!

Respuesta aceptada

Matt J
Matt J el 11 de Sept. de 2021
The area constraint is non-linear. You would have to use fmincon instead.

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by