Rebin a vector
Syntax: |
REBIN x y n
|
Suppose that the length of vector x
is N then:
that is, the length of y
will be
N/n
, and
If is not equal to N, then the last
element of
y
will be incomplete. For example, if
N = 10
and n y
will have 3
elements:
y[1] = x[1] + x[2] + x[3] y[2] = x[4] + x[5] + x[6] y[3] = x[7] + x[8] + x[9]
and x[10]
will not be included in y
.
Examples
Suppose that vector X
has 20
elements and vector DATA
has
1000
elements.
command | result | |||||||||||||||
REBIN X XOUT 2 |
|
|||||||||||||||
REBIN DATA DOUT 3 |
|
A warning will be given that the length of DATA
is not
evenly divisible by 3
and so the last bin is incomplete.