如何通过给出中心点将抛物线拟合到 MATLAB 中的数据?

How to fit a parabola to data in MATLAB by giving the center point?

我有一组数据,在绘制 x 与 y 时,将给出此 figure.I want to fit a parabola to this data and I've tried using the curve fitting tool in MATLAB. The only problem is that I'm getting an answer as shown here 中的绘图。我知道抛物线的中心或峰值应该在的坐标。但是当我使用自定义方程选项时,出现错误 "this expression has no coefficients or non scalar coefficients"。我是新来的。有没有办法指定中心并正确拟合?中心点是 (352,595)。谢谢

你用手画的黑色东西不是抛物线。它不遵循 y=a*x^2+b 等式,因此您无法适应它。它实际上遵循 y=±sqrt(a*x)+b 。我不确定你是否可以为这个方程拟合一个函数(实际上它们是 2 个方程)。

如评论中所建议,您可以做的是交换 X/Y 坐标并以这种方式拟合数据。然后你可以对结果抛物线进行数值插值并再次交换坐标以使其保持原始形式。

但是,请注意,如果您这样做,每个 X 都会有 2 个解决方案,并且 none 还会有很多解决方案。