12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

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.

surf, surfcPurpose2surf, surfc3-D shaded surface plotSyntaxDescriptionsurf(Z)surf(X,Y,Z)surf(X,Y,Z,C)surf(...,'PropertyName',PropertyValue)surfc(...)h = surf(...)h = surfc(...)Use surf and surfc to view mathematical functions over a rectangular region.surf and surfc create colored parametric surfaces specified by X, Y, and Z, withcolor specified by Z or C.surf(Z) creates a a three-dimensional shaded surface from the z componentsin matrix Z, using x = 1:n and y = 1:m, where [m,n] = size(Z). The height,Z, is a single-valued function defined over a geometrically rectangular grid. Zspecifies the color data as well as surface height, so color is proportional tosurface height.surf(X,Y,Z) creates a shaded surface using Z for the color data as well assurface height. X and Y are vectors or matrices defining the x and y componentsof a surface. If X and Y are vectors, length(X) = n and length(Y) = m, where[m,n] = size(Z). In this case, the vertices of the surface faces are( X( j) , Y()Zi i , ( , j)) triples.surf(X,Y,Z,C) creates a shaded surface, with color defined by C. <strong>MATLAB</strong>performs a linear transformation on this data to obtain colors from the currentcolormap.surf(...,'PropertyName',PropertyValue) specifies surface properties alongwith the data.surfc(...) draws a contour plot beneath the surface.h = surf(...) and h = surfc(...) return a handle to a surface graphicsobject.2-468

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

Saved successfully!

Ooh no, something went wrong!