MATLAB: How to get the fitted data by using Matlab’s “Fit” Function

matlab surface fit

For example, by using below code
load franke;
fitresult = fit( [x, y], z, 'poly33' );
From fitresult, I can get the formula used to fit x,y and z data
But how can I get the fitted data matrix via this "fit" function?

Best Answer

It gives you a 1-D vector, but that 1-D vector is a polynomial in two variables, hence it is a function of the form f(x,y)=z
Calling
formula(fitresult)
shows you exactly what the terms in x and y the coefficients multiply
Related Question