function [fitresult, gof] = createFit(x, y, z)
[xData, yData, zData, weights] = prepareSurfaceData( x, y, z, z );
ft = fittype( 'poly53' );
opts = fitoptions( 'Method', 'LinearLeastSquares' );
opts.Normalize = 'on';
opts.Weights = weights;
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
figure( 'Name', 'polynomial test' );
h = plot( fitresult, [xData, yData], zData );
legend( h, 'polynomial test', 'z vs. x, y with z', 'Location', 'NorthEast' );
xlabel x
ylabel y
zlabel z
grid on
view( 125.7, 36.4 );