RegularizeData3D

RegularizeData3D is a modified version of GridFit from the Matlab File Exchange. RegularizeData3D does essentially the same thing, but is an attempt to overcome several shortcomings inherent in the design of the legacy code in GridFit.

* GridFit lacks cubic interpolation capabilities. Interpolation is necessary to map the scattered input data to locations on the output surface. The output surface is most likely nonlinear, so linear interpolation used in GridFit is a lousy approximation. Cubic interpolation accounts for surface curvature, which is especially beneficial when the output grid is coarse in x and y.

* GridFit's "smoothness" parameter was poorly defined and its methodology may have led to bad output data. In RegularizeData3D the smoothness parameter is actually the ratio of smoothness (flatness) to fidelity (goodness of fit) and is not affected by the resolution of the output grid.
Smoothness = 100 gives 100 times as much weight to smoothness (and produces a nearly flat output surface)
Smoothness = 1 gives equal weight to smoothness and fidelity (and results in noticeable smoothing)
Smoothness = 0.01 gives 100 times as much weight to fitting the surface to the scattered input data (and results in very little smoothing)
Smoothness = 0.001 is good for data with low noise. The input points nearly coincide with the output surface.

* GridFit didn't do a good job explaining what math it was doing; it just gave usage examples.

Both of these links include Excel spreadsheets that break down the calculations step by step so that you can see how RegularizeData3D works. There are also very limited (and very slow!) Excel spreadsheet functions that do the same thing in 2D or 3D.

I use this iteratively: fit a "rubber sheet", remove outliers and repeat. Works amazing, accurate and fast!

Is it possible to use same methodology on 2D data, perhaps hack or trick this function? I don't wish to use excel... I like the options this gives for dealing with boundaries and I am not sure I can replicate this functionality on 2d data.

I have been using this almost a week everyday. I work with a lot of tables of data. This function allows me to work a table of data rather than fitting a multidimensional polynomial type function. RegularizeData3D is an extremely useful tool.

I have been using this almost a week everyday. I work with a lot of tables of data. This function allows me to work a table of data rather than fitting a multidimensional polynomial type function. RegularizeData3D is an extremely useful tool.

I just started using this function today. I am amazed at how effective this function is at smoothing while maintaining the accuracy and integrity of the 3d surface. I definitely recommend use of this function. Well done!

This function provides an excellent solution for fitting surfaces to irregularly-spaced data using a bicubic fit. Generating a 200,000 element surface from 65,000 GPS measurments takes about six seconds on my laptop.

A fine contribution to FEX.

Updates

05 Jun 2014

1.1

The smoothing parameter now produces consistent behavior for input datasets with a very large or very small domain. (Previously the smoothing parameter was affected by the size of the input domain in x and y.)