surfnorm(Z)
surfnorm(X, Y, Z)
Nx = surfnorm(...)
[Nx, Ny] = surfnorm(...)
[Nx, Ny, Nz] = surfnorm(...)
| Parameter | Description |
|---|---|
| Z | Surface height data, specified as a real numeric matrix with at least three rows and three columns. |
| X, Y | Surface coordinate matrices with the same size as Z. |
| Parameter | Description |
|---|---|
| Nx, Ny, Nz | Normalized surface normal vector components. |
surfnorm computes unit normal vectors for a surface. With no output arguments, it displays the surface and draws one normal segment at each surface point.
When only Z is specified, the x- and y-coordinates are the column and row indices of Z.
[X, Y, Z] = peaks(20);
surfnorm(X, Y, Z);
[Nx, Ny, Nz] = surfnorm(peaks(10));