Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*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 2005

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

Search the Archive

Re: Summary: Which[] as Textbook Input, Plot[] Questions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54053] Re: Summary: Which[] as Textbook Input, Plot[] Questions
  • From: Joel Storch <jstorch at earthlink.net>
  • Date: Wed, 9 Feb 2005 09:27:25 -0500 (EST)
  • References: <cua5gn$hhl$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

you can use the conditional operator "/;"

f[x_]:=Sin[x]/x/;x>0
f[x_]:=Sin[x]/x/;x<0
f[x_]:=1/;x==0

Alternatively, the following will also work

Clear[f]
f[0]:=1
f[x_]:=Sin[x]/x


  • Prev by Date: precision of numbers
  • Next by Date: Plotting just specific points
  • Previous by thread: Re: Summary: Which[] as Textbook Input, Plot[] Questions
  • Next by thread: Re: Summary: Which[] as Textbook Input, Plot[] Questions