On Tue, 3 Feb 2009, Franck Nadaud wrote:
thank you for your response, I just read it today morning and so
I could test the small script you sent and compare with mine.
Well, here are the results:
1) you script works perfectly well;
That's good to hear.
2) the first part of mine also... now I can define my matrices
by named list assignement and it works ok.
Hmm, but what accounts for the change in this respect?
I guess there is some arcane win XP problem around here... gretl
does not seem to be culprit !
This is very unlikely to be a problem with the operating system.
I'd still be interested to see the entire script that failed.
But now I have problems with the second segment of my script :
############################################################################
matrix W1=zeros(257,258)
list contigus1 = 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
matrix VW1={contigus1}
loop i = 1..257 --quiet
scalar row=$i
loop j = 1..15 --quiet
scalar col=VW1[$i,$j]
matrix W1[row,col]=1
end loop
end loop
############################################################################
When i run it: gretl says :
gretl version 1.8.0
Current session: 2009/02/03 15:38
? matrix W1=zeros(257,258)
Replaced matrix W1
? list contigus1 = 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
Replaced list contigus1
? matrix VW1={contigus1}
Replaced matrix VW1
? loop i = 1..257 --quiet
> scalar row=$i
> loop j = 1..15 --quiet
> scalar col=VW1[$i,$j]
> matrix W1[row,col]=1
> end loop
> end loop
Index value 0 is out of bounds
>> matrix W1[row,col]=1
>> loop j = 1..15
i dont see why he finds an index value 0 while the loops are
indexed from 1 to 257 for i and 1 to 15 for j ?
You're trying to set W1[row,col]. The "row" value is obtained
from the loop index i, and therefore should run from 1 to 257, as
you say. But "col" is obtained as VW1[i,j]. From looking at your
script, we don't know what values this will take on, and it
appears that for some i and j VW1[i,j] = 0.
Allin.