[new, grid] = regrid1(data, col, grid, method )
This Matlab function regrids separately each columns of an array on a new common grid. One of these column is the regrid axis and is specified by column number col. If grid is not specified, a new grid is automatically generated with these values, using function new_grid(3m). Data are interpolated on the new grid using Matlab function interp1.
Input values along column col may contain bad values, and do not need to be monotonic. However, on output, the lines are sorted into increasing order, and all lines with bad data in column col are removed. Duplicate data values on the same grid point are averaged together.
Bad data are not sent to interp1, so that gaps with bad data along the grid column should be correctly filled with interpolated values.
Array of data to be regridded. Each column contains data for the same variable given at different grid points.
Column number to use for regridding.
Vector of grid points on which data should be regridded (default is to generate a regular grid starting and ending at the same points defined in the given column and with the same number of points).
Regrid method to use (default is linear). See Matlab function interp1 for more information.
The array of regridded data,with the same structure as the input data.
The new grid.
Pierre Jaccard, Geophysical Institute, University of Bergen, 1999