Can I get the mathematical expression of an interpolation?
조회 수: 5(최근 30일)
Hello everyone. I am working with interpolated data.
I want to obtain the mathematical expression of the interpollating polynomial. I have written
sfX1 = fit([positions(:,1), positions(:,2)],windX_in_the_node_vector,'poly34')
And the output returns the linear model poly which is what I am looking for, f(x,y)=a*x^3+b*y^3+...
However, I would be interested in using other kinds of interpolations. I have tried linear, lowess, linearinterp, cubicinterp and nearest and instead of poly34. Unfortunately, instead of a polynomial such as the one in poly34, the code returns
sfX2(x,y) = piecewise linear surface computed from p
p = coefficient structure
and so on. Is there a way for me to obtain the mathematical expressions as the ones in poly34?
Steven Lord 2021년 10월 8일
편집: Steven Lord 2021년 10월 8일
Are you looking for a mathematical expression for the fitted model or do you just want to be able to evaluate the fitted model at new points? In the former case, how were you hoping to use such an expression? If the latter case, that's easy.
f = fit(cdate, pop, 'linear', 'Normalize', 'on')
plot(cdate, pop, 'r-+', 1977, f(1977), 'ko') % Evaluate f in 1977
Looks like a pretty good match.