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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

surfaceRemarksUnlike high-level area creation functions, such as surf or mesh, surface doesnot respect the settings of the figure and axes NextPlot properties. It simplyadds the surface object to the current axes.If you do not specify separate color data (C), <strong>MATLAB</strong> uses the matrix (Z) todetermine the coloring of the surface. In this case, color is proportional tovalues of Z. You can specify a separate matrix to color the surfaceindependently of the data defining the area of the surface.You can specify properties as property name/property value pairs, structurearrays, and cell arrays (see set and get for examples of how to specify thesedata types).surface provides convenience forms that allow you to omit the property namefor the XData, YData, ZData, and CData properties. For example,surface('XData',X,'YData',Y,'ZData',Z,'CData',C)is equivalent to:surface(X,Y,Z,C)When you specify only a single matrix input argument,surface(Z)<strong>MATLAB</strong> assigns the data properties as if you specified,surface('XData',[1:size(Z,2)],...'YData',[1:size(Z,1)],...'ZData',Z,...'CData',Z)The axis, caxis, colormap, hold, shading, and view commands set graphicsproperties that affect surfaces. You can also set and query surface propertyvalues after creating them using the set and get commands.ExampleThis example creates a surface using the peaks M-file to generate the data, andcolors it using the clown image. The ZData is a 49-by-49 element matrix, while2-475

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

Saved successfully!

Ooh no, something went wrong!