View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Contour Line Smoothing

5.0 | 1 rating Rate this file 14 Downloads (last 30 days) File Size: 3.07 KB File ID: #38862 Version: 1.0
image thumbnail

Contour Line Smoothing



Smooths contour lines by fitting them with a 2-D spline.

| Watch this File

File Information

CONTOURSPLINE(X,Y,Z,N) creates a contour plot having N contour levels from the matrix Z, treating the values in Z as heights above the X-Y plane. X and Y are either vectors defining the X- and Y-axes with length(X) = size(Z,2) and length(Y) = size(Z,1), or X and Y are matrices the same size as Z such as those produced by MESHGRID.
CONTOURSPLINE(X,Y,Z,V) draws contours at the levels given in vector V.
CONTOURSPLINE(X,Y,Z,[v v]) draws a single contour line at level v.

Beware: CONTOURSPLINE smooths contours, but does not magically change terrible data into pleasing data. For terrible data, smoothed contour lines may cross!

Required Products MATLAB
MATLAB release MATLAB 7.2 (R2006a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
10 Nov 2016 Peter Buxton

Hi Duane,
Is there any way of better calculating the arc length instead of using the hypotenuse?

Comment only
17 Apr 2014 Jade Chantrell

Hi Duane, this code is really helpful, but is there a way I can change this function to make it a filled contour plot like the function CONTOURF ? Cheers

Contact us