Skip to Main Content
Mathematica 錦囊妙計
book

Mathematica 錦囊妙計

by Sal Mangano
April 2014
Beginner to intermediate content levelBeginner to intermediate
830 pages
15h 21m
Chinese
GoTop Information, Inc.
Content preview from Mathematica 錦囊妙計
15.12 於互動式介面中設置區域函數
|
621
解決方案
使用
DynamicModule
包裝
Manipulate
指令,搭配使用
Initialization
選項建立函數的
定義。下式定義了一個全域函數
f[x]
及兩個設置了區域函數的
Manipulate
指令,且它
們之間是互不干擾的。
[Page-623]
討論說明
Manipulate
指令只能建立區域操控變數,而這可能導致不同的
Manipulate
因為使用相
同函數名稱而互相干擾。以下
Out[54]
輸出中,很明顯第二次定義的
g[x]
影響了第一個
函數,因為第一個互動介面的
Sin[x]
應該要輸出 -1 1 之間的數值。
ch15.indd 621 2014/4/2 下午 03:40:15
622
|
第十五章
須注意的是,在訣竅 15.9 中討論的
SaveDenitions
True
選項並不會建立區域函數,
因此無法解決問題。[Page-624]
15.13  於不同單元或視窗的 DynamicModule
共享變數
問題點
你想建立一個互動式介面,其橫跨數個單元甚至是 notebook 檔案,並能共享變數,但卻
又不想將它們設為全域變數。
ch15.indd 622 2014/4/2 下午 03:40:16
15.14 建構自訂控制元件
|
623
解決
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9789863470106