Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Piecewise' topicStudent Support Forum > General > "Piecewise"

Next Comment >Help | Reply To Topic
Author Comment/Response
10/12/02 10:49am

I am in an Advanced Engineering math class at Cal Poly, SLO and in most of our homework we use piecewise functions such as f(x)= 1 for 0<x<1, -1, for 1<x<2, all else equals 0. In our class we use Maple to do our labs and homework but I prefer using Mathematica ( I also own the Student version of Mathematica and would like to use i for homework). How do I enter a piecewise funcion into Mathematica? In Maple the above funcion would look something like this:

f := x -> piecewise(x<0,0, x<1, 1, x<2, -1, 0);

Is there something similar in Mathematica? Thanks for any info.

URL: ,

Subject (listing for 'Piecewise')
Author Date Posted
Piecewise Chad 10/12/02 10:49am
Re: Piecewise Tim Cooper 10/14/02 10:57am
Re: Piecewise Henry Lamb 10/14/02 11:10pm
Next Comment >Help | Reply To Topic