12.07.2015 Views

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

Basics of MATLAB and Beyond

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

x 294x1 2352 double arrayxi 50x50 20000 double arrayxiv 1x50 400 double arrayy 294x1 2352 double arrayyi 50x50 20000 double arrayyiv 1x50 400 double arrayz 294x1 2352 double arrayzi 50x50 20000 double arrayGr<strong>and</strong> total is 8711 elements using 68314 bytesWe now have three new matrix variables xi, yi, <strong>and</strong> zi that correspondto the interpolated data. We make a plot <strong>of</strong> the original data <strong>and</strong> theinterpolated surface:plot3(x,y,z,’o’)hold onsurf(xi,yi,zi)colormap(autumn)axis tightWhere the points <strong>of</strong> the rectangular interpolation grid lie outside theconvex hull defined by the data, the values are interpolated as NaN <strong>and</strong>are omitted from the surface plot. There are a variety <strong>of</strong> ways to do theinterpolation; these are described in the help entry for griddata. Wecan use the interpolated data to plot a contour map <strong>of</strong> the seamount:contour(xi,yi,zi)36.2 Triangular Griddingmatlab comes equipped with the following functions for use in definingtriangular grids:griddata delaunay trimesh dsearchconvhull voronoi trisurf tsearchThe idea is that for any set <strong>of</strong> points (distinct <strong>and</strong> with no colinearsubsets) in two dimensions, a set <strong>of</strong> triangles can be defined such that(1) no points lie within any triangle’s circumcircle <strong>and</strong> (2) the set completelycovers the convex hull <strong>of</strong> the points. This idea is illustrated in thisc○ 2000 by CRC Press LLC

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!