FUNCTION REFERENCE
surface
Low-level grid surface.
Low-level grid surface.
Syntax
surface(Z)Syntax
surface(Z, C)Syntax
surface(X, Y, Z)Syntax
surface(X, Y, Z, C)Syntax
surface(..., Name, Value)Syntax
surface(ax, ...)Syntax
h = surface(...)Adds one surface to the current axes. Unlike surf, it does not clear existing series and does not change the view, including when hold is off. With no axes yet, the new axes keep the 2-D view. Z is a real matrix of at least 2-by-2 (at most 1000000 elements). X is a vector with one value per column of Z, or a matrix of Z's size; Y is a vector with one value per row of Z, or a matrix of Z's size. A vector and the matching matrix describe the same quadrilaterals: point (i, j) is (X(j), Y(i), Z(i, j)), or (X(i, j), Y(i, j), Z(i, j)) when X and Y are matrices. C defaults to Z. Face colours, holes, the face limit and the other properties are the same as surf. h is a scalar graphics handle and h.Type is 'surface'.
FaceLighting accepts 'none', 'flat', 'gouraud' or 'phong' (default 'flat'). get returns that word. The drawn colours stay the flat or interpolated CData colours; light objects are not simulated.
Example
h = surface([10 20 30], [1; 2], [1 2 3; 4 5 6]); h.TypeExample
h = surface([1 2 3; 4 5 6], 'EdgeColor', 'none', 'LineStyle', 'none', 'FaceLighting', 'phong'); h.FaceLightingLighting properties include FaceLighting, EdgeLighting, BackFaceLighting, AmbientStrength, DiffuseStrength, SpecularStrength, SpecularExponent and SpecularColorReflectance.
Differences from MATLAB: Lighting properties are stored but do not affect rendering. the same colour approximation and face limit as surf. FaceLighting does not light the faces.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.