Suppose I have a function of a variable f
, depending on some other parameters a
and b
, for example:
fun[f_,a_,b_] := Sin[a*f] + Cos[b*f]
I can plot and manipulate this function for some independent values of the parameters a
and b
:
Manipulate[Plot[fun[f,a,b], {f, 0, 10}], {a,0,5},{b,0,5}]
Now, suppose I would like to give discrete values to these parameters, and change both at the same time. For example,I define two points:
A = Sequence[1,1];
and
B = Sequence[4,2];
I can do this plots:
Plot[fun[f,A], {f, 0, 10}]
or Plot[fun[f,B], {f, 0, 10}]
but when I try to combine them, in order to include the possibility to manually choose between 'A' or 'B',
Manipulate[Plot[fun[f, X], {f, 0, 10}], {X, A, B}]
I obtain an empty plot... Instead, I would like to get a plot with two button, 'A' and 'B', corresponding to two different pairs of values for the parameters a and b.
I tried to use List[ ]
instead of Sequence[ ]
, but it failed to work too! I also tried Row[ ]
, adding some braces but nothing happened... :(
What should I do? Where is the problem with my code?
Thank you all in advance!