I tried the following code and others to change the type of operation using PopupMenu
:
ClearAll[plus, minus, index, hesap];
plus[x_, y_] := x + y;
minus[x_, y_] := x - y;
index = {plus, minus};
Manipulate[
hesap[x, y],
{{hesap, 1, "operation type"},
Thread[Range[Length[index]]->index], ControlType -> PopupMenu},
{x, 1, 10},
{y, 1, 10}
]
This code does not work in the way I expect. What is missing in the code?
index
toindex = {Plus, Subtract};
and changeManipulate[hesap[x, y], ...
toManipulate[index[[hesap]][x, y], ...
$\endgroup$Manipulate
to do calculations. If I use {Plus, Subtract}, in effect I useMathematica
functions which I do not want to. $\endgroup$