|MATLAB Function Reference|
A sample function of two variables.
peaks is a function of two variables, obtained by translating and scaling Gaussian distributions, which is useful for demonstrating
contour, and so on.
Z = peaks; returns a 49-by-49 matrix.
Z = peaks(n); returns an
Z = peaks(V); returns an
n matrix, where
n = length(V).
Z = peaks(X,Y); evaluates
peaks at the given
Y (which must be the same size) and returns a matrix the same size.
peaks(...) (with no output argument) plots the peaks function with
[X,Y,Z] = peaks(...); returns two additional matrices,
Y, for parametric plots, for example,
surf(X,Y,Z,del2(Z)). If not given as input, the underlying matrices
V is a given vector, or
V is a vector of length
n with elements equally spaced from -3 to 3. If no input argument is given, the default
n is 49.