MathGroup Archive 2009

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

Search the Archive

Re: how to build pattern for a square matrix of reals?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98438] Re: how to build pattern for a square matrix of reals?
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Thu, 9 Apr 2009 05:59:41 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <grhp95$mj7$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de

Hi,

f[_?(MatrixQ[#,NumberQ] &)]:= ..

but usual better is

f[_?(MatrixQ[#,NumericQ] &)]:= ..

but this test not only reals.

Regards
   Jens

sagrailo at gmail.com wrote:
> As in subject: how to build a pattern that will specify that given
> argument of a function has to be square matrix of reals?  Tried with
> following for "square matrix" part:
>   f[x_?MatrixQ[#] && Dimensions[#][[1]] == Dimensions[#][[2]]
> &] := ...
> but it doesn't seem to be working...
> 
> Thanks.
> 


  • Prev by Date: Re: how to build pattern for a square matrix of reals?
  • Next by Date: Re: how to build pattern for a square matrix of reals?
  • Previous by thread: Re: how to build pattern for a square matrix of reals?
  • Next by thread: Re: how to build pattern for a square matrix of reals?