RE: problems with the definition of a function
- To: mathgroup at smc.vnet.net
- Subject: [mg36665] RE: [mg36651] problems with the definition of a function
- From: "DrBob" <drbob at bigfoot.com>
- Date: Wed, 18 Sep 2002 02:09:48 -0400 (EDT)
- Reply-to: <drbob at bigfoot.com>
- Sender: owner-wri-mathgroup at wolfram.com
>>and has a different expression for all the other values of y. Do you mean "all the other values of x"? You can't expect to make yourself understood to Mathematica, if you don't say what you mean. Mathematica can't guess, like we can. If that's what you meant, it's really easy: f[0 | N[0], y_] := y f[2*Pi | N[2*Pi], y_] := y^2 f[4*Pi | 4.*Pi, y_] := y^3 f[x_, y_] := y^4 If the first three of those expressions are supposed to be the same, you can substitute f[0 | N[0] | 2*Pi | N[2*Pi] | 4*Pi | 4.*Pi, y_] := y^3 Bobby Treat -----Original Message----- From: fabio bagarello [mailto:bagarell at unipa.it] To: mathgroup at smc.vnet.net Subject: [mg36665] [mg36651] problems with the definition of a function 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