Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

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

Search the Archive

Re: Specify a variable

  • To: mathgroup at
  • Subject: [mg33913] Re: Specify a variable
  • From: Jens-Peer Kuska <kuska at>
  • Date: Tue, 23 Apr 2002 07:13:23 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <a9muer$a8v$>
  • Reply-to: kuska at
  • Sender: owner-wri-mathgroup at


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


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