<< surf | Graphics functions | text >> |
surface(X, Y, Z) |
surface(X, Y, Z, C) |
surface(Z) |
surface(Z, C) |
surface(parent, ...) |
surface(..., propertyName, propertyValue) |
go = surface(...) |
x-coordinates: vector or matrix.
y-coordinates: vector or matrix.
z-coordinates: vector or matrix.
Color array: m-by-n-by-3 array of RGB triplets.
a scalar graphics object value: parent container, specified as a axes.
a scalar string or row vector character.
a value.
a graphics object: surface type.
surf and surface functions are both used to create 3D surface plots, but there are some slight differences between the two.
surf function is used to plot a surface defined by a function of two variables, or by a set of scattered data points.
It requires three input arguments: X, Y, and Z. X and Y define the coordinates of the data points, and Z defines the height of the surface at each point.
surf function also provides additional options for customizing the appearance of the plot, such as lighting and color.
surface function is used to plot a surface defined by a matrix of data. It requires three input arguments: X, Y, and Z. X and Y define the coordinates of the data points, and Z is a matrix that defines the height of the surface at each point.
The size of Z must match the size of X and Y. The surface function also provides additional options for customizing the appearance of the plot, such as lighting and color.
In summary, both surf and surface functions are used for 3D surface plots but surf is used for a surface defined by a function of two variables or by a set of scattered data points, while surface is used for a surface defined by a matrix of data, and the size of Z must match the size of X and Y.
f = figure();
data = peaks(50);
ax1 = subplot(1, 2, 1);
s1 = surface(ax1, data);
ax2 = subplot(1, 2, 2);
s2 = surf(ax2, data);
Version | Description |
---|---|
1.0.0 | initial version |
Allan CORNET