On Sat, 17 Apr 2010, Henrique Andrade wrote:
I'd attached a .pdf file into this e-mail to show you a little
bit better
what exactly I need.
On that basis, here's an example:
<script>
matrix r = mshape(seq(1,144),12,12)
print r
scalar m = 7 # number of values to compute
scalar n = 6 # number of elements to sum
matrix R_n = zeros(m,1)
loop i=1..m -q
loop j=1..n -q
row = i + n - j
R_n[i] += r[row, j]
# see what's going on
printf "i=%d: adding r[%d,%d] (%g)\n", i, row, j, r[row, j]
endloop
endloop
print R_n
</script>
Allin