  1.  NAME

  avg_ascii1 - Average columns from different input files together

  2.  SYNOPSIS

  [new, grid] = avg_ascii1(files, col, 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. If only files is specified, it is assumed
  that each line of data correspond to the same grid point, and data
  from the different files are avergaed together as is. This requires
  the files to have the same number of lines.

  If col is specified, a new grid, common to all datasets is calculated,
  and all other columns are regridded on this new grid. This is carried
  out by function regrid(3m).

  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 regrid1(3m), bad data along the regrid
  axis is allowed, and duplicate grid points oqn input will be averaged
  together.

  4.  PARAMETERS

     files
        Cell array of file names containing columnar ASCII data to be
        averaged together. Instead of passing file names,you can also
        pass a cell array of data already processed.

     col optional
        Column number to use for regridding data to a common grid before
        averaging.

     grid optional
        Grid on which data should be averaged (default is to build a
        default grid).  This parameters requires parameter col to be
        defined.

     method optional
        Method to use for regridding data (default is linear). See
        Matlab function interp1 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

