ControlActive[act,norm]
act に影響するコントロールがアクティブに使用されている場合に評価すると act となり,その他の場合には norm となる.
ControlActive
ControlActive[act,norm]
act に影響するコントロールがアクティブに使用されている場合に評価すると act となり,その他の場合には norm となる.
詳細
- ControlActiveは,スライダーのようなコントロールが動かされている間は計算速度の速い計算を行い,コントロールが解放されると時間がかかる計算を行うというような切り換えに使うことができる.
- ControlActive[act,norm]は,コントロールがリリースされたときに norm の評価を引き起すために使うこともできる.
- ControlActive[]はControlActive[True,False]に等しい.
- ControlActive[act,norm]は,実質的にIf[$ControlActiveSetting,act,norm]に等しい.
例題
すべて開く すべて閉じるスコープ (2)
ControlActiveの引数は任意の式でよい:
Manipulate[ControlActive[u, Graphics[Circle[{0, 0}, u], PlotRange -> 2]], {u, 0, 1.5}]ControlActiveを使って低解像度と高解像度とを切り換える:
Manipulate[ArrayPlot[CellularAutomaton[n, {{1}, 0}, {ControlActive[10, 100], All}]], {n, 1, 64, 1}]アプリケーション (2)
マニピュレータがアクティブに使われていないときだけ音を出す:
Manipulate[ControlActive[w, EmitSound[Play[Sin[1000 w t], {t, 0, .2}]];w], {w, 1, 3}]アクティブに操作している場合にはサンプリング数を少なくする:
Manipulate[Plot[Sin[1 / (x - a)], {x, 0, 1}, PlotPoints -> ControlActive[5, 50], PlotRange -> 1], {a, 0, 1}]特性と関係 (2)
Dynamicの第2引数を使うことでControlActiveと同じような効果が得られる:
Manipulate[ControlActive[u, u Range[4]], {u, 0, 1}]{Slider[Dynamic[u, {(u = p = #)&, (u#;p = # Range[4])&}]], Dynamic[p]}PerformanceGoalの設定にプロット関数は実質的にControlActiveを使う:
Manipulate[Plot3D[Sin[a x]Sin[b y], {x, 0, 3}, {y, 0, 3}, PerformanceGoal -> ControlActive["Speed", "Quality"], PlotRange -> 1], {a, 1, 3}, {b, 1, 3}]テクニカルノート
関連するガイド
テキスト
Wolfram Research (2007), ControlActive, Wolfram言語関数, https://reference.wolfram.com/language/ref/ControlActive.html.
CMS
Wolfram Language. 2007. "ControlActive." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ControlActive.html.
APA
Wolfram Language. (2007). ControlActive. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ControlActive.html
BibTeX
@misc{reference.wolfram_2026_controlactive, author="Wolfram Research", title="{ControlActive}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/ControlActive.html}", note=[Accessed: 08-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_controlactive, organization={Wolfram Research}, title={ControlActive}, year={2007}, url={https://reference.wolfram.com/language/ref/ControlActive.html}, note=[Accessed: 08-September-2026]}