Dear Artur and Allin,

Thank you so much for your invaluable help. Now everything is working
really fine! With the use of the Gretl scripting language I'm going to save
a lot of time (these tasks are part of my PhD thesis).

Best regards,
Henrique

2010/4/18 Allin Cottrell <cottrell(a)wfu.edu>

>
> 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
>
Dear Artur and Allin,

Thank you so much for your invaluable help. Now everything is working
really fine! With the use of the Gretl scripting language I'm going to save
a lot of time (these tasks are part of my PhD thesis).

Best regards,
Henrique

2010/4/18 Allin Cottrell <cottr...@wfu.edu>

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

Reply via email to