MathGroup Archive 2007

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

Search the Archive

Re: pattern

  • To: mathgroup at
  • Subject: [mg84344] Re: pattern
  • From: Albert Retey <awnl at>
  • Date: Wed, 19 Dec 2007 23:59:34 -0500 (EST)
  • References: <> <fkanuj$dlh$>

orelang at wrote:
> I want to define a function that accepts only one argument - a 2x2
> matrix and not any more.
> Is it possible?
> orelang

f[m:{{_,_},{_,_}}]:=(your code goes here)

for other cases more general patterns can be constructed with MatrixQ 
and Dimensions. Probably you want to also check for the entries to be 
numbers with NumericQ.



  • Prev by Date: Mathematica fonts
  • Next by Date: Re: express a quadratic, in the form (x+a)^2 + b
  • Previous by thread: Re: pattern
  • Next by thread: Re: Re: pattern