ifelse - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


convert/ifelse

convert to ifelse expression

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

convert(expr, ifelse)

convert(expr, ifelse, recurse)

Parameters

expr

-

expression to convert

Options

• 

recurse : true or false

  

This option specifies whether the transformation should be applied to subexpressions of the original expression expr. The default is false.

Description

• 

The convert(expr, ifelse) command accepts a Maple piecewise expression and return a result written in terms of nested calls to the ifelse function.

Examples

Convert a piecewise with three branches to nested ifelse calls.

ppiecewise2<x&comma;1&comma;1<x&comma;2&comma;3

p12<x21<x3otherwise

(1)

convertp&comma;ifelse

ifelse2<x&comma;1&comma;ifelse1<x&comma;2&comma;3

(2)

Convert a nested piecewise to ifelse with and without the recurse option.

ppiecewise2<x&comma;1&comma;piecewisex2<y&comma;x2&comma;0<y&comma;x&comma;0

p12<xx2x2<yx0<y0otherwiseotherwise

(3)

convertp&comma;ifelse

ifelse2<x&comma;1&comma;x2x2<yx0<y0otherwise

(4)

convertp&comma;ifelse&comma;recurse

ifelse2<x&comma;1&comma;ifelsex2<y&comma;x2&comma;ifelse0<y&comma;x&comma;0

(5)

Compatibility

• 

The convert/ifelse command was introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

See Also

convert

ifelse