Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: how to effectively define a subsection function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49772] Re: how to effectively define a subsection function
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Fri, 30 Jul 2004 06:02:24 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 7/29/04 at 7:45 AM, dbjunxiao at hotmail.com (Xiaoxun) wrote:

>For example, if I want to specify Z[x_,y_] to have different
>function form at different region of R{x,y},

There are a number of ways this can be accomplished, For example,

z[x_]:=If[x<0, x, x^2]

z[x_]:=x/; x<=0
z[x_]:=x^2/;x>0

z[x]:=(x^2 - x)UnitStep[x] + x

Here, I've used a single variable function to make things simple. But all of these can be extended to multi-variable functions by adding whatever criteria is needed for the additional variables
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Pad a sign - and + to a list of lists
  • Next by Date: Re: time delays
  • Previous by thread: Re: how to effectively define a subsection function
  • Next by thread: time delays