  1.  NAME

  avg_ascii2 - Average 3-Dimensional data from different input files

  2.  SYNOPSIS

  [new, grid] = avg_ascii2(files, x, y, grid, method )

  3.  DESCRIPTION

  This Matlab function calculates averages of data between different
  ascii columnar files. Each column specifies the values of a variable
  at different grid points.

  Parameters x and y specify the columns to be used as x/y points. A
  common grid to all datasets is determined, and data are regridded onto
  this new grid. If grid is specified, it is taken as the new grid.

  The interpolation method for regridding can be specified by method.

  Since regridding is done by regrid2(3m), bad data along the regrid
  axes is allowed, and duplicate grid points on input will be averaged
  together.

  4.  PARAMETERS

     files
        Cell array of file names containing columnar ascii data to be
        averaged together. Files may also be a cell array of already
        processed data.

     x  Column number to use for regridding data along a common x grid
        before averaging.

     y  Column number to use for regridding data along a common y grid
        before averaging.

     grid optional
        Grid on which data should be averaged (default is to build a
        default grid).  It must be a cell array with 2 column vectors
        specifying the new grid points where x=grid{1} and y=grid{2}.

     method optional
        Method to use for regridding data (default is linear). See
        Matlab function griddata for more information.

  5.  RETURNS

     new
        Array with averaged data on the new grid.

     grid optional
        The new grid points.

  6.  AUTHORS

  Pierre Jaccard, Geophysical Institute, University of Bergen, 1999

