Fit to just half a parabola

7 次查看(过去 30 天)
Sven
Sven 2015-3-4
编辑: Sven 2015-3-4
Hi there, I have some simple XY data, and I can fit a quadratic to it as follows:
X = [25.4 30.48 35.56 40.64 45.72 50.8 63.5 76.2];
Y = [12443 9560.9 7381.1 5834.8 4740.6 3926.8 2723.5 2072.4];
p = polyfit(X,Y,2);
x1 = linspace(min(X),max(X),100);
y1 = polyval(p,x1);
figure, plot(X,Y,'o', x1, y1)
What I'd like to do however is to add a constraint and fit only the left half of a parabola. In other words, I would like to constrain my fit such that the underlying model (and therefore result) has a turning point at an X location equal to or greater than my maximum X observation.
How should go about applying such constraints? I'm guessing this is now an optimization toolbox problem rather than just solving a linear set of equations.
Thanks, Sven.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by