MathGroup Archive 2003

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

Search the Archive

Re: Defining function

One of the nicest things about Mathematica is that although you are 
clearly a beginner you have almost got it right!

f[t_]/;t>0 :=Exp[-I t];
f[t_]/;t<0 := 0;

Note that when you do that f[0] remains undefined. You can define it 
separately, e.g

f[0] := Sqrt[Pi] or whatever.

Andrzej Kozlowski
Yokohama, Japan

On 13 Nov 2003, at 21:36, Ravinder Kumar B. wrote:

> Dear All,
> How to define a function over two different ranges in mathematica.
> For example
> f(t):= Exp[-i*t]  for t > 0   and
>      = 0          for t < 0
> Your response/clarification will be deeply appreciated.
> Regards,
> Ravi

  • Prev by Date: Re: Defining function
  • Next by Date: Re: Defining function
  • Previous by thread: Defining function
  • Next by thread: Re: Defining function