PLS_Toolbox Documentation: coadd< cluster coda_dw >

coadd

Purpose

Reduce resolution through combination of adjacent variables or samples.

Synopsis

 

databin = coadd(data,bins,options)

Description

COADD is used to combine ("bin") adjacent variables, samples, or slabs of a matrix. Inputs include the original array data, the number of elements to combine together bins {default: 2}, and an optional options structure options.

Unpaired values at the end of the matrix are padded with the least biased value to complete the bin. Output is the co-added data. Unlike DERESOLV, COADD reduces the size of the data matrix by a factor of 1/bins for the dimension.

Example

Given a matrix, data, size 300 by 1000, the following would coadd variables in groups of three:

databin = coadd(data,3);

and the following would coadd samples in groups of two:

 

options.dim = 1;

databin = coadd(data,2,options);

 

The following is equivalent to the previous two lines.

 

databin = coadd(data,2,struct('dim',1));

Options

                        dim:   Dimension in which to do combination {default = 2},

                     mode:   [ 'sum' | {'mean'} | 'prod' ] method of combination.

Algorithm

The three modes, sum, mean and prod behave according to the following (described in terms of variables):

SUM: groups of variables are added together and stored. The resulting values will be larger in magnitude than the original values by a factor equal to the number of variables binned.

MEAN: groups of variables are added together and that sum is divided by the number of variables binned. The resulting values will be similar in magnitude to the original values.

PROD: groups of variables are multiplied together.

See Also

deresolv, registerspec


< cluster coda_dw >