PEAKS

 

 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

  MESH2O6LFXR, SURF1F43EU2, PCOLOR7C1IVA, CONTOURXAOYTS, etc.

  There are several variants of the calling sequence:

 

 

      Z = 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);

 

 

  The first variant produces a 49-by-49 matrix.

  The second variant produces an N-by-N matrix.

  The third variant produces an N-by-N matrix where N = length(V).

  The fourth variant evaluates the function at the given X and Y,

  which must be the same size.  The resulting Z is also that size.

 

 

  The next four variants, with no output arguments, do a SURF1F43EU2

  plot of the result.

 

 

  The last three variants also produce two matrices, X and Y, for

  use in commands such as PCOLOR7C1IVA(X,Y,Z) or SURF1F43EU2(X,Y,Z,DEL216NX1U2(Z)).

 

 

  If not given as input, the underlying matrices X and Y are

      [X,Y] = MESHGRID1Y7VXN8(V,V) 

  where 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.