Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'plotting piecewise formula' topicStudent Support Forum > General > Archives > "plotting piecewise formula"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
Mikel
10/30/06 09:28am

f(x) = 0 , when x<= -1
f(x) = sqrt(1-x^2) when -1<x<1
f(x) = x when x>=1

Sure, you can do it with Piecewise[{{expr1,cond1},{expr2,cond2},...}]

in your case:
f[x_]:=Piecewise[{{0,x<=1},{Sqrt[1-x^2],-1<x<1},{x,x>=1}}]

good luck

URL: ,

Subject (listing for 'plotting piecewise formula')
Author Date Posted
plotting piecewise formula Iqram Mahmud 10/28/06 11:17am
Re: plotting piecewise formula yehuda ben-s... 10/29/06 04:38am
Re: plotting piecewise formula Mikel 10/30/06 09:28am
Re: plotting piecewise formula Iqram Mahmud 10/31/06 10:43pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic