1
$\begingroup$

I have a little problem using the Manipulate command.

I am trying to write down the parameter control of a function that is entered into this command not explicitly. But in this case, the variable parameter "does not cling" to the function and the command does not work.

I will show what I mean.

In this case, the command works successfully.

Manipulate[Plot[Sin[2*(x + x^Sin[1*a])], {x, 0, 30}], {a, 0, 10}]

enter image description here

In this case, nothing happens.

f = Sin[2*(x + x^Sin[1*a])]

Manipulate[Plot[f, {x, 0, 30}], {a, 0, 10}]

enter image description here

At the same time, RegionPlot3D, SurfacePlot3D, etc. successfully work as I need.

What am I doing wrong?

$\endgroup$
1
  • $\begingroup$ It seems I found a solution: Append multiple plots with Manipulate I mean, we need "constructions" like this. I'm right? That is, write the parameters to the function name in square brackets. Fx [b_, c_, y_, x_]: = Sin [x / c] + Cos [b y] $\endgroup$
    – ayr
    Commented Apr 14, 2020 at 14:25

1 Answer 1

1
$\begingroup$

Try this:

Clear[f];
f[x_, a_] := Sin[2*(x + x^Sin[1*a])]

Manipulate[Plot[f[x, a], {x, 0, 30}], {a, 0, 10}]

Have fun!

$\endgroup$
1
  • $\begingroup$ Yes it works. Thank you! $\endgroup$
    – ayr
    Commented Apr 14, 2020 at 14:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.