gpt4 book ai didi

wolfram-mathematica - 使用 Mathematica 中的 Manipulation 函数 :

转载 作者:行者123 更新时间:2023-12-02 03:08:07 25 4
gpt4 key购买 nike

如何将 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com