On Mon, 4 Mar 2013, Pindar wrote:
Hi,
I encountered that a matrix that 'is null' cannot be filtered by
'isnull':
That's because there's a difference between an empty matrix and a null
matrix. In fact, isnull() is typically used to check for optional matrix
arguments in functions. See the following script snippet:
<hansl>
function void boo(matrix *a[null])
if isnull(a)
printf "Ha!\n"
else
printf "Nope\n"
endif
end function
function scalar isempty(matrix a)
return (rows(a) == 0 || cols(a) == 0)
end function
matrix test = {1,0,3;1,1,100}
boo(&test)
boo()
matrix seek = selifr(seek,seek[,2].=2)
eval seek
eval isempty(seek)
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------