contourc
Contour matrix computation
📝Syntax
M = contourc(Z)
M = contourc(X, Y, Z)
M = contourc(..., levels)
📥Input Arguments
Parameter Description
X x-coordinates: vector or matrix.
Y y-coordinates: vector or matrix.
Z z-coordinates: numeric matrix.
levels Contour levels: scalar count, vector of levels, or [k k] for one level.
📤Output Arguments
Parameter Description
M Two-row contour matrix.
📄Description

contourc computes the contour matrix used by contour plotting functions without creating axes, figures, or graphics objects.

Each contour segment starts with a header column. The first row contains the contour level and the second row contains the number of points in that segment. The following columns contain x and y point coordinates.

💡Examples
Compute contour lines for a matrix.
Z = peaks(20);
M = contourc(Z, 5)
🔗See Also
contourcontourfcontour3
🕔Version History
Version Description
1.17.0 initial version
Edit this page on GitHub