How to use polynomials after curve fitting 3D points?

5 ビュー (過去 30 日間)
Reza Ebrahimi Ghiri
Reza Ebrahimi Ghiri 2018 年 4 月 8 日
Hi, I am using curve fitting tool to find a polynomial relationship Z = f(X,Y). Although a surface is well fitted to my X, Y, and Z data, whenever I plug in X and Y data to f(X,Y), the result is very different from the original value of Z. Why? Attached are three figures from polynomial curve fitting, representing the same thing with different angles. I would appreciate any ideas.
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 4 月 8 日
Are you evaluating the sfit object at the locations to get the predicted values? https://www.mathworks.com/help/curvefit/sfit.html Or are you extracting coefficients and calculating the values yourself?
Reza Ebrahimi Ghiri
Reza Ebrahimi Ghiri 2018 年 4 月 27 日
I extract coefficients and calculate the values.

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2018 年 4 月 8 日
編集済み: John D'Errico 2018 年 4 月 8 日
Almost always when someone says this, they have tried to fit a high order polynomial. Then they copied the coefficients with about 4 digits of precision, and thought that would be sufficient to evaluate the polynomial. It is not. The result will be complete garbage.
Use the correct coefficients. The ENTIRE number. In fact, don't type in the coefficients at all. Extract them as the actual numbers that were returned.
Best of course, is to avoid using high order polynomials at all. But people love them. Taylor series are based on them so they must fit well. Often, they don't really fit that well, even if the residuals are small. But sometimes they do sufficiently well.
  1 件のコメント
Reza Ebrahimi Ghiri
Reza Ebrahimi Ghiri 2018 年 4 月 8 日
Hi John, Thank you for your quick and helpful answer.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by