convert/pwlist
convert a piecewise function to a list
Calling Sequence
Parameters
Description
Examples
convert(piecewise, pwlist, x)
piecewise
-
piecewise expression
pwlist
literal name
x
(optional) name; specify variable
A piecewise expression, such as f1cond1f2cond2...` `, is converted into an ordered list f1,t1,f2,t2,...,fn,tn,fn+1 which represents the piecewise-defined function:
fiwhenti−1<x<ti,i=1,2,…,n+1.
Here, t0=−∞ and tn+1=∞ are implicit.
The variable x can be stated as an extra argument to the convert function. If x is not stated then the variable name is deduced if there is exactly one name appearing in the expression.
f≔piecewise−1<xandx≤0,x3,0<xandx≤π2,sinx,π2<x,1+cosx:
convertf,pwlist,x
0,−1,x3,0,sinx,π2,1+cosx
g≔piecewisex<1,a−x,1≤x,lnx:
convertg,pwlist,x
a−x,1,lnx
See Also
convert
convert/piecewise
Download Help Document