Quiz1
PROBLEM 6
Which of the following will create a popup menu to allow the user to choose from among theoptions {“Sine”,“Cosine”,“Tangent”} to select the function for the plot?
Manipulate[Plot[f[x],{x,0,2Pi}],{f,{Sine,Cosine,Tangent},ControlTypePopupMenu}]
Manipulate[Plot[f[x],{x,0,2Pi}],{f,{Sin“Sine”,Cos“Cosine”,Tan“Tangent”},ControlTypePopupMenu}]
Manipulate[Plot[f[x],{x,0,2Pi}],{f,{Sin“Sine”,Cos“Cosine”,Tan“Tangent”}}]
Manipulate[Plot[f[x],{x,0,2Pi}],{f,{Sine,Cosine,Tangent}}]
None of them work correctly! Your example uses [OpenCurlyDoubleQuote] vs "!
This causes the error: Manipulate[Plot[f[x], {x, 0, 2*Pi}],
{{f, Sin}, {Sin → CurlyDoubleQuote[Sine], Cos →
CurlyDoubleQuote[Cosine],
Tan → CurlyDoubleQuote[Tangent]}, ControlType → PopupMenu}]
in the PopupMenu in the Manipulate panel..
This works:
Manipulate[Plot[f[x], {x, 0, 2 Pi}], {f, {Sin → Sine, Cos → Cosine, Tan → Tangent}, ControlType → PopupMenu}]