kelvin goh

20 Reputation

2 Badges

3 years, 355 days

MaplePrimes Activity


These are replies submitted by kelvin goh

@Carl Love 

Thanks, However, as I understand above command is for Maple 2015. How about the command for Maple 18?

Thanks  a lot.

As refer to the command on piecewise function

http://www.maplesoft.com/support/help/Maple/view.aspx?path=piecewise

 

 

Calling Sequence

 

piecewise(cond_1, f_1, cond_2, f_2, ..., cond_n, f_n, f_otherwise)

 

With the piecewise function it is possible to express piecewise-continuous functions.  The semantics are as in a case statement: if cond_1 is true then f_1, else if cond_2 is true then f_2, and so on. f_otherwise gives a default case which corresponds to all conditions being false.  The default for f_otherwise is 0.

 

so, when I try to define the function on above command as:

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

f(0) = 0.

Page 1 of 1