Fit to just half a parabola
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interpolation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!