Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Piecewise function in two variables' topicStudent Support Forum > General > "Piecewise function in two variables"

Next Comment >Help | Reply To Topic
Author Comment/Response
Eric Burling
04/08/04 05:54am

Am relative new-comer to Mathematica (v 5.0) and need to define a piecewise function in 2 variables f[x,y] to cover 2 distinct argument ranges e.g. For 0<x<5 and 0<y<10 f[x,y]=x^2+2y
For 5<=x and 10<=y f[x,y]=3x-9y
Have tried :-
f[x_,y_]:=x^2+2y/;{0<x<5 And 0<y<10}
f[x_,y_]:=3x-9y/;{5<=x And 10<=y}
but this does'nt seem to work. Am I missing something obvious?

URL: ,

Subject (listing for 'Piecewise function in two variables')
Author Date Posted
Piecewise function in two variables Eric Burling 04/08/04 05:54am
Re: Piecewise function in two variables Henry Lamb 04/10/04 11:48pm
Re: Piecewise function in two variables Carol Ting 04/19/04 7:42pm
Next Comment >Help | Reply To Topic