MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: strange behaviour



Jean-Marie THOMAS wrote:
> 
> MatrixQ has a strange behaviour:
> 
> ?MatrixQ
> "MatrixQ[expr] gives True if expr is a list of lists that can represent
> a \ matrix, and gives False otherwise. MatrixQ[expr, test] gives True
> only if \ test yields True when applied to each of the matrix elements
> in expr."
> 
> MatrixQ[{{},{}}] gives True because its argument is a list of lists of
> equal length. No problem.
> 
> Now:
> NumberQ[{}] gives False because {} is not a number. I can understand
> that.
> 
> But:
> MatrixQ[{{},{}},NumberQ] gives True, and this seems to me in
> contradiction with the definition of MatrixQ[expr, test]
> 
> Can somebody explain this to my stupid mind?
> 
> -----------------------------------------------
> 
> Jean-Marie THOMAS
> Conseil et Audit en Ingenierie de Calcul jmthomas@cybercable.tm.fr
> +33 (0)3 88 32 93 64
> www.cybercable.tm.fr/~jmthomas
> =======================


Jean-Marie,

Perhaps a rewording:

"For all e if e is an entry in {{},{}} then NumberQ[e] gives True." 

Since a implies b is false iff a is true and b is false, this is true.

or

" There is no entry, e, in {{},{}} for which NumberQ[e] give False"


Related results

MatchQ[{},{___?NumberQ}]

True

MatchQ[{},{_?NumberQ...}]

True


Allan

-- 
Allan Hayes
Training and Consulting
Leicester, UK
hay@haystack.demon.co.uk
http://www.haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44 (0)116 271 8642




  • Prev by Date: compiled functions
  • Next by Date: Re: Re: MathLive Professional and Mathematica3.01
  • Prev by thread: Re: strange behaviour
  • Next by thread: Fuzzy Logic Pack