[new, grid] = avg_ascii1(files, col, grid, method )
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.
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.
Column number to use for regridding data to a common grid before averaging.
Grid on which data should be averaged (default is to build a default grid). This parameters requires parameter col to be defined.
Method to use for regridding data (default is linear). See Matlab function interp1 for more information.
Array with averaged data on the new grid.
The new grid points.
Pierre Jaccard, Geophysical Institute, University of Bergen, 1999