Navigation

Operators and Keywords

Function List:

C++ API

: sombrero ()
: sombrero (n)
: z = sombrero (…)
: [x, y, z] = sombrero (…)

Plot the familiar 3-D sombrero function.

The function plotted is

z = sin (sqrt (x^2 + y^2)) / (sqrt (x^2 + y^2))

Called without a return argument, sombrero plots the surface of the above function over the meshgrid [-8,8] using surf.

If n is a scalar the plot is made with n grid lines. The default value for n is 41.

When called with output arguments, return the data for the function evaluated over the meshgrid. This can subsequently be plotted with surf (x, y, z).

See also: peaks, meshgrid, mesh, surf.

Demonstration 1

The following code

 clf;
 colormap ("default");
 sombrero ();
 title ("sombrero() function");

Produces the following figure

Figure 1

Package: octave