fsurf

Shaded surface plot of a function of two variables, given as a handle.

Category: Graphics > 2-D and 3-D Plots

Syntax

fsurf(f)

Draws z = f(x,y) as a surface over the default domain -5 < x < 5, -5 < y < 5.

fsurf(f, [min max])

Uses the same interval for x and y.

fsurf(f, [xmin xmax ymin ymax])

Sets each interval.

fsurf(funx, funy, funz)

Plots a parametric surface in u and v.

h = fsurf(___)

Also returns the surface handle.

Description

fsurf evaluates the function on its own grid and draws a colored surface. It replaces ezsurf. For data you already hold in matrices use surf.

Input arguments

f
Function handle of x and y that accepts arrays.
funx, funy, funz
Handles of u and v for a parametric surface.
'MeshDensity'
Number of sample points along each direction.

Output arguments

h
Handle to the surface object.

Example

Gaussian bump

fsurf(@(x,y) x.*exp(-x.^2 - y.^2), [-2 2])

In the app, the figure is drawn below the code.

See also

fmesh surf ezsurf fcontour