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

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Tim Cooper
10/14/02 10:57am

Try using the Condition operator /;

Here is a plot example:

Clear[x, f];

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

Plot[ f[x], {x,-3,3}];


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
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic