Plot a surface through X-Y-Z data in 3D

Plots X-Y-Z data in 3D using the SURF command. Does not need the Curve Fitting Toolbox.
1.9K Downloads
Updated 20 Feb 2011

View License

plotunevenData allows you to fit a 3D surface to X-Y-Z data even though the data may not be evenly spread in the X-Y plane. Note that TriScatteredInterp is used for the Z value interpolation rather than griddata.

plotunevenData takes up to 9 parameters, 8 of which are optional. It can plot data from *.mat files and also *.xls files so long as they are arranged in X,Y,Z column vector format. More on this further down.

plotunevenData allows you to switch off the data points or display them on the fitted 3D surface. You may also choose from 3 interpolant methods, label the axes and choose your own colormap. You can also specify the resolution of the 3D surface plot.

I have included some screen-shots in the zipped file that demonstrate the figures the function can produce. I also include some sample 3D data. Of course you may use your own data, just make sure the data is *.mat or *.xls file format and the correct column vector format. The program will convert your *.xls file to *.mat file the first run through and then load it as *.mat the second time around.

For more detail please type:

>> help plotunevenData

Cite As

Bruce Raine (2024). Plot a surface through X-Y-Z data in 3D (https://www.mathworks.com/matlabcentral/fileexchange/30475-plot-a-surface-through-x-y-z-data-in-3d), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0