Polynomial surface fitting failed
4 次查看(过去 30 天)
显示 更早的评论
I am trying to use the polynomial fitting function to fit my surface X=[30 60 60 60 90] Y=[280 260 280 300 280] Z=[0.0060 0.0053 0.00438 0.0042 0.0034]
I am choosing degree of x to be 1, and degree of y to be 2, Matlab keeps telling me equation is badly conditioned. Remove repeated data points or trying center and scaling. It still gave me the same results when I checked the box of "center and scale".
I have several sets of other data similar to this by the fitting is working. I don't know what should I do now with this set of data.
Thanks!
回答(1 个)
John D'Errico
2014-2-26
You have 5 (count them, FIVE) data points. At least they are reasonably well scattered.
You are trying to estimate a model with how many terms? WHAT IS YOUR MODEL?
sf = fit([X',Y'],Z','poly12')
Warning: Equation is badly conditioned. Remove repeated data points or try centering and scaling.
> In Warning>Warning.throw at 30
In fit>iLinearFit at 690
In fit>iFit at 396
In fit at 108
Linear model Poly12:
sf(x,y) = p00 + p10*x + p01*y + p11*x*y + p02*y^2
Coefficients:
p00 = 1.507e+14
p10 = -2.512e+12
p01 = -5.384e+11
p11 = 8.973e+09
p02 = -4.48e-05
Your data simply does not justify fitting that model. At best, you have 5 coefficients and 5 data points. The fit would be exact if your data were more conducive to fitting that model, but the data is not sufficient to estimate ALL 5 coefficients uniquely.
Get better data. Or use a simpler model.
(While you COULD use gridfit, as Star Strider suggested) it depends on your goals here. Do you need a model, or do you just want a surface plot?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Polynomials 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!