Code covered by the BSD License  

Highlights from
scatterquad2

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 2.04 KB File ID: #31805

scatterquad2

by Ben Petschel

 

15 Jun 2011

calculates the volume under a surface defined by scattered points

| Watch this File

File Information
Description

scatterquad2(X,Y,Z) finds the volume under the surface defined by the points (X(i),Y(i),Z(i)) with linear interpolation on the Delaunay triangulation of (X,Y) and Z=0 outside the convex hull of (X,Y).

Example:
load seamount
scatterquad2(x,y,z-min(z)) % returns 190.7996
inR = (x>=211.1 & x<=211.4 & y>=-48.35 & y<=-48);
scatterquad2(x,y,(z-min(z)).*inR) % returns 142.3083
scatterquad2(x,y,1) % returns 0.2696

This function is *much* faster than using DBLQUAD with TriScatteredInterp, or similar methods.

For functions that can be evaluated at arbitrary points, use DBLQUAD or QUAD2D instead. For regular grids, instead use TRAPZ twice.

MATLAB release MATLAB 7.10 (2010a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
quad2 Ben Petschel 15 Jun 2011 10:06:13
dblquad Ben Petschel 15 Jun 2011 10:06:13
delaunay Ben Petschel 15 Jun 2011 10:06:13

Contact us at files@mathworks.com