如何将 slider 变量的范围扩展到“Manipulate”函数之外?在此编码中,“Manipulate”函数前后的“n”= 10,但在绘图例程中可以在 -10 和 +10 之间变化。
n = 10;
Manipulate[
Plot[Sin[n*x], {x, -5, 5}], {n, -10, 10, 1, Appearance -> "Labeled"}]
Print["n = ", n]
提前感谢所有贡献者。 诺曼
最佳答案
在 Manipulate 中为控制变量使用另一个变量名。
n = 10;
Manipulate[
Plot[Sin[(n = m)*x], {x, -5, 5}], {{m, n}, -10, 10, 1, Appearance -> "Labeled"}]
Print["n = ", Dynamic[n]]
关于wolfram-mathematica - 使用 Mathematica 中的 Manipulation 函数 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41403547/