
第十五章
互動式控制元件
I’m alive
Oh oh, so alive
I’m alive
Oh oh, so alive
...
My head is full of magic, baby
And I can share this with you
The feel I’m on top again, baby
That’s got everything to do with you
Love and Rockets, “So Alive”
15.0 導論
Mathematica 第 6 版發布的重頭戲是互動式控制元件的支援,為了實作這項功能,導致
Mathematica 必須重新檢視並設計其前端介面,不幸導致許多 Mathematica 第 5 版以前
的 notebook 檔案無法直接於第 6 版中執行,特別是使用到圖形的 notebook。儘管如此,
我認為這犧牲絕對是值得的。[Page-593]
Mathematica 第 6 版所提供的互動式控制元件功能,絕對比你想像中更讓人驚艷。互動
式控制元件的核心為
Manipulate
指令,可以將它想像為智慧型使用者介面產生器;根
據所輸入表示式及其變數宣告,它將產生一個內嵌於 notebook 的小型圖形化使用者介面
(GUI),作為使用者與該表示式互動的平台。當然,使用過程中難免會出現警告或錯
誤訊息,本章目的之一便是藉由
Manipulate
指令的使用案例,協助你以最適當的方式使
用它。
本章前 5 個訣竅將循序漸進地帶領你深入
Manipulate
指令的使