This is an example:
f[x : {{_?NumericQ, _?NumericQ}, {_?NumericQ, _?NumericQ}}] := x
The pattern object {{_?NumericQ, _?NumericQ}, {_?NumericQ, _?NumericQ}}
matches a numerical 2x2 matrix, and the x: preceding it is the name that I
have assigned to this pattern object for use inside the function definition.
If you want to match other types of matrix element then change the tests as
necessary.
Stephen Luttrell
West Malvern, UK
<orelang at gmail.com> wrote in message news:fkanuj$dlh$1 at smc.vnet.net...
>I want to define a function that accepts only one argument - a 2x2
> matrix and not any more.
>
> Is it possible?
>
> orelang