Hello everyone.
I have a matrix 40000*3. The first column are X positions, the second, Y positions and the third, values of f(x, y). I have used NonlinearModelFit to find a polynomial which fits said data (called F). The problem is that I need a huge number of terms. I have been asked to plot this new surface using Matlab.
I would like to know if it is possible to evaluate the polynomial F at the points defined by the pairs X and Y positions obtaining as a result a vector of size 40000*1 which later on I can export to Matlab, where I can use a contourf.
I have also tried to copy the plynomial by hand as:
for i=1:number_of_points
w_x_1_reconstructed(i)=-5.63591*x(i)+0.324034*x(i)^2-0.00683514*x(i)^3+0.0000485218*x(i)^4+710.999*y(i)-54.1068*x(i)*y(i)+1.47658*x(i)^2*y(i)-0.0174122*x(i)^(3)*y(i)+0.0000711661*x(i)^4*y(i)+27.2783*y(i)^2-1.79134*x(i)*y(i)^2+0.0390551*x(i)^2*y(i)^2-0.000305961*x(i)^3*y(i)^2+(4.60362*10^(-7))*x(i)^4*y(i)^2+0.372277*y(i)^3-0.0206956*x(i)*y(i)^3+0.000304779*x(i)^2*y(i)^3+(3.15853*10^(-7))*x(i)^3*y(i)^3-(2.24926*10^(-8))*x(i)^4*y(i)^3+0.00164353*y(i)^4-0.00006926*x(i)*y(i)^4+(2.79603*10^(-8))*x(i)^3*y(i)^4-(2.70495*10^(-10))*x(i)^4*y(i)^4;
end
but the resulting figure looks nothing at all as the original f(x, y). I am attaching my .nb file in case it is helpful.
Any advice on how to proceed is appreciated. Thanks.
Attachments: