Code covered by the BSD License

### Highlights from RegularizeData3D

5.0
5.0 | 3 ratings Rate this file 51 Downloads (last 30 days) File Size: 645 KB File ID: #46223 Version: 1.1

# RegularizeData3D

by

### Jamal (view profile)

14 Apr 2014 (Updated )

Produces a smooth surface from scattered 3D input data.

File Information
Description

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.

For a detailed explanation of "the math behind the magic" on a 3D dataset, see:
http://mathformeremortals.wordpress.com/2013/07/22/introduction-to-regularizing-3d-data-part-1-of-2/

and to apply the same principles to a 2D dataset see:
http://mathformeremortals.wordpress.com/2013/01/29/introduction-to-regularizing-with-2d-data-part-1-of-3/

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.

Acknowledgements

Surface Fitting Using Gridfit inspired this file.

Required Products MATLAB
MATLAB release MATLAB 8.3 (R2014a)
25 Aug 2015 Jason Nicholson

### Jason Nicholson (view profile)

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.

Comment only
25 Aug 2015 Jason Nicholson

### Jason Nicholson (view profile)

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.

20 Aug 2015 Jason Nicholson

### Jason Nicholson (view profile)

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!

12 Feb 2015 joneauin

### joneauin (view profile)

Hi I would love to try this software, my z values are stored in a matrix though, is it possible to use this matrix as input for RegularizeData3D?

Comment only