12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

peaksPurpose2peaksA sample function of two variables.SyntaxZ = peaks;Z = peaks(n);Z = peaks(V);Z = peaks(X,Y);peaks;peaks(N);peaks(V);peaks(X,Y);[X,Y,Z] = peaks;[X,Y,Z] = peaks(n);[X,Y,Z] = peaks(V);Descriptionpeaks is a function of two variables, obtained by translating and scalingGaussian distributions, which is useful for demonstrating mesh, surf, pcolor,contour, and so on.Z = peaks; returns a 49-by-49 matrix.Z = peaks(n); returns an n-by-n matrix.Z = peaks(V); returns an n-by-n matrix, where n = length(V).Z = peaks(X,Y); evaluates peaks at the given X and Y (which must be the samesize) and returns a matrix the same size.peaks(...) (with no output argument) plots the peaks function with surf.[X,Y,Z] = peaks(...); returns two additional matrices, X and Y, forparametric plots, for example, surf(X,Y,Z,del2(Z)). If not given as input, theunderlying matrices X and Y are:[X,Y] = meshgrid(V,V)where V is a given vector, or V is a vector of length n with elements equallyspaced from −3 to 3. If no input argument is given, the default n is 49.See Alsomeshgrid, surf2-349

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!