MmaTranslator[Mma]
Which
evaluate a specified test and return the value
Calling Sequence
Parameters
Description
Examples
Which(arguments)
arguments
-
Maple translation of the Mathematica command arguments
The Which command evaluates a specified test and returns its value corresponding to the first on the yields TRUE.
with⁡MmaTranslatorMma:
h:= proc (x) options operator, arrow; Which(x < -2, x/3, x > 3, x^2, true, 0) end proc;
h≔x↦MmaTranslator:−Mma:−Which⁡x<−2,x3,3<x,x2,true,0
h⁡6
36
h⁡2
0
Alternatively, you can use the FromMma command with the evaluate option specified.
with⁡MmaTranslator:
FromMma⁡`h[x_]:=Which[x < -2, x/3, x > 3, x^2, True, 0]`,evaluate
x↦Which⁡x<−2,x3,3<x,x2,true,0
h⁡−5
−53
See Also
MmaTranslator
MmaTranslator[FromMma]
Download Help Document