MathGroup Archive 2002

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

Search the Archive

Re: Specify a variable


Hi,

Mathematica has not data types, it use  patterns.

A floating point argument is the restricted pattern:

YourFunction[x_Real]:=Some code

and a pattern for a matrix is restricted by:

YourMatrixFunction[m_?MatrixQ]:=some othe code

Regards
  Jens

Guojun Zhu wrote:
> 
> Can I indicate a variable's type, a function, a real number, a matrix or
> a complex number?
> 
> Can I specify it in functions such as D[], Integrate?


  • Prev by Date: Why these graphs differ?
  • Next by Date: Re: how to make and paint an interpolation of two variables
  • Previous by thread: Specify a variable
  • Next by thread: numerical methods for PDE