This problem is solved surprisingly with a basic matrix math equation.
If A = [x1,x2,x3,...,xN]
then
A
#
[1,
1,
1,
...,
1]
will equal:
[ [x1,x2,x3,...,xN],
[x1,x2,x3,...,xN],
[x1,x2,x3,...,xN],
...,
[x1,x2,x3,...,xN] ]
The IDL statement that performs this is:
B = A # transpose(fltarr(N) + 1)
... assuming that A is a single-precision floating point datatype.
James Jones
|