Degree of polynomial surface fitting (cftool - fit)

9 views (last 30 days)
Good morning,
I need to fit a surface from a set of experimental points using a polynomial model. Curve fitting toolbox (cftool) allows to perform it and to obtain polynomial coefficients up to fifth degree for x and y. The fitted surface is not enough accurate and I would like to increase the polynomial degree.
How can I increase the polynomial degree of the surface?
Thank you!

Answers (1)

Rishabh Mishra
Rishabh Mishra on 4 Sep 2020
Hi,
You can use the ‘polyfitn’ toolbox to serve your required purpose. The ‘polyfitn()’ function is able to accurately predict the coefficients of higher degree (degree > 5) polynomials given the ‘x’ & ‘y’ values.
The general syntax for the function is:
% define the degree of polynomial
deg = 8
fit = polyfitn(x,y,deg)
‘fit.Coefficients’ stores the coefficient values of the polynomial.
Hope This helps.

Community Treasure Hunt

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

Start Hunting!