Re: problems with the definition of a function
- To: mathgroup at smc.vnet.net
- Subject: [mg36658] Re: problems with the definition of a function
- From: lalu_bhatt at yahoo.com (Bhuvanesh)
- Date: Wed, 18 Sep 2002 02:09:35 -0400 (EDT)
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
bagarell at unipa.it (fabio bagarello) wrote: > Hi there!! > I have quite an easy and annoying problem with mathematica: > I need to define a function f(x,y) which takes some values for > x=0,2pi,4pi (indepently of y) and has a different expression for all > the other values of y. This is easily done for one-dimensional > functions but I am in serious troubles for my two-dimensional problem: > any suggestion? > Thanks a lot, > Fabio Hi, Something like this? In:= f[x_,y_] := If[Mod[x,2*Pi] === 0, Exp[x], Sin[y]+x] In:= f[4*Pi, y] 4 Pi Out= E In:= f[1, y] Out= 1 + Sin[y] -- Bhuvanesh, Wolfram Research.