3
votes

How is it possible to extend the scope of the slider variable beyong the 'Manipulate' function? In this coding 'n' = 10 before and after the 'Manipulate' function but can vary between -10 and +10 in the plot routine.

n = 10;
Manipulate[
   Plot[Sin[n*x], {x, -5, 5}], {n, -10, 10, 1, Appearance -> "Labeled"}]
   Print["n = ", n]   

Thank you in advance for all contributors. Norman

1

1 Answers

1
votes

Use another variable name for the control variable in the Manipulate.

n = 10;
Manipulate[
 Plot[Sin[(n = m)*x], {x, -5, 5}], {{m, n}, -10, 10, 1, Appearance -> "Labeled"}]
Print["n = ", Dynamic[n]]