Hi,
I stumbled over some details of gretl's automatic conversion from
1-element matrices to scalars. See:
<hansl>
m = {3.3}
eval typeof(m) # 3 (matrix)
eval typeof(m[1]) # 1 (scalar)
eval typeof(m[1,]) # 1 (scalar)
</hansl>
I find the last result a bit inconvenient; the "1," specifies an entire
row IMHO, and it's just by coincidence that it only has one element. The
one-element property also isn't the relevant criterion as can be seen
from the first result on the "full" one-element matrix m. The
implication is that doing nelem(m[1,]) fails in this case because of a
wrong type (scalar).
So either it would be good if a row or column-indexing specification
returned a matrix type, or alternatively if nelem() worked on a scalar
as well (and would then return the value 1).
This is with 2020d.
thanks
sven