<< param3d_properties 3d_plot plot3d >>

Scilab Help >> Biblioteca de Gráficos > 3d_plot > peaks

peaks

Computes values of a function with lots of local maxima and minima.

Syntax

[XX, YY, ZZ] = peaks()
[XX, YY, ZZ] = peaks(n)
[XX, YY, ZZ] = peaks(x, y)
ZZ = peaks(...)

Arguments

n

Grid size. Default value is 49.

x

Grid over X-axis.

y

Grid over Y-axis.

XX, YY, ZZ

Computed coordinates.

Description

peaks returns the Cartesian coordinates of peaks function (without drawing it). The returned coordinates can be then plotted using surf. If n is a scalar, then coordinates are computed over a n x n grid. If n is a vector, then the coordinates are computed over a grid defined by n values (used for X-axis and Y-axis). When called with two input arguments, peaks computed coordinates over a grid defined by x values (for X-axis) and by y values (for Y-axis).

When called with only one output argument, peaks returns only z-coordinates.

The peaks function is defined as

Examples

[x, y, z] = peaks(-4:0.2:4);
surf(x, y, z);
gcf().color_map = jet(64);

See also

History

VersionDescription
2025.1.0 Function peaks introduced.

Report an issue
<< param3d_properties 3d_plot plot3d >>