No BSD License  

Highlights from
Slicing 3-D data: Obtaining Coordinates of Contour Polygons

5.0

5.0 | 3 ratings Rate this file 19 Downloads (last 30 days) File Size: 3.44 KB File ID: #8453
image thumbnail

Slicing 3-D data: Obtaining Coordinates of Contour Polygons

by Michael Kleder

 

08 Sep 2005 (Updated 09 Sep 2005)

For MATLAB 7 or later. Returns actual coordinates of polygons representing contour lines ....

| Watch this File

File Information
Description

If you've used the CONTOUR function, you know how easy and fast it is, but you also know that it's difficult to extract the actual polygon coordinates of the contour lines in your data. Such coordinates are needed for any calculation beyond simple contour plotting. Two examples would be (1) determining whether a particular point is within a contour line, and (2) determining the area of a region inside a contour line. This function provides that capability in a user-friendly way.

GETCON - compute coordinates of contour lines (Matlab 7 or later)

[xc,yc] = contour(X,Y,Z,v)

X,Y,Z = coordinates of a function Z=f(X,Y), where X and Y are matrices of the sort generated by meshgrid or ndgrid and Z is the value of the function of X and Y at each corresponding matrix element

v = one or optionally, more than one, contour altitude(s)

If v is a scalar:

[xc,yc] = Column vectors containing the NaN-delimited polygon(s) defining the contour slice at altitude v

If v is a vector:

[xc,yc] = Cell arrays of column vectors. Each entry cell array entry contains the NaN-delimited polygon(s) defining the contour slice at the altitude in the corresponding entry in v. For example, if v is a vector with three entries, then xc and yc will be cell arrays, each with three entries. The first cell array entry in xc and the first cell array entry in yc will each contain a vector. Those vectors are the x and y coordinates of the NaN-delimited polygons defining the contour slice at the altitude specified by the first entry in v.

Notes:
(1) Version 1.0, initial writing, Michael Kleder, Sep 2005
(2) This application is VERY SENSITIVE TO MATLAB VERSION. This function is written for MATLAB 7.
(3) No warranty. Use at your own risk.

MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
17 Nov 2006 Alexi Ivanov  
17 Sep 2007 Luke Owens

Very easy to use.

25 Oct 2011 Rashbeard

nice file, works well

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data exploration Michael Kleder 22 Oct 2008 07:59:39
contour Michael Kleder 22 Oct 2008 07:59:39
coordinate Michael Kleder 22 Oct 2008 07:59:39
altitude Michael Kleder 22 Oct 2008 07:59:39
slice Michael Kleder 22 Oct 2008 07:59:39
polygon Michael Kleder 22 Oct 2008 07:59:40
coordinates Michael Kleder 22 Oct 2008 07:59:40

Contact us at files@mathworks.com