Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Drawing a plot' topicStudent Support Forum > General > Archives > "Drawing a plot"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Henry Lamb
10/03/03 7:44pm

Here are two ways to define your function.

teht7a[x_]:=Which[
0<=x<1,x(2-x),
1<=x<2,1
2<=x<=4,(4-x)/2

or

teht7a[x_]:
x(2-x)UnitStep[x(1-x)]+
UnitStep[(x-1)(2-x)]+
(4-x)/2 UnitStep[(x-2)(4-x)]

Then you can plot it with

Plot[teht7a[x],{x,0,4}];


URL: ,

Subject (listing for 'Drawing a plot')
Author Date Posted
Drawing a plot Riikka 09/14/03 10:34am
Re: Drawing a plot Henry Lamb 10/03/03 7:44pm
< Previous CommentHelp | Reply To Comment | Reply To Topic