regrid1(3m)

NAME
regrid1 - Regrid columnar data along a new grid

SYNOPSIS
[new, grid] = regrid1(data, col, grid, method )

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

PARAMETERS

data
    Array of data to be regridded. Each column contains data for the same variable given at different grid points.

col Column number to use for regridding.

grid optional
    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).

method optional
    Regrid method to use (default is linear). See Matlab function interp1 for more information.

RETURNS

new The array of regridded data,with the same structure as the input data.

grid optional
    The new grid.

AUTHORS
Pierre Jaccard, Geophysical Institute, University of Bergen, 1999