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 錦囊妙計
110
|
第三章
3.7 操作矩陣的行與列
問題點
你想新增、移除或修改矩陣的行或列。[Page-110]
解決方案
許多串列的操作(包含矩陣等高維度串列)並不會修改輸入串列,而是輸出處理後的新
串列。例如,
Append[myList,10]
將輸出新串列,而不會更改到
myList
串列,但有時候
你就是想要修改原始串列。
建立5乘5的零矩陣
設定第2行為{1,2,3,4,5}
設定第3列為3
設定3乘3的子矩陣為9
ch03.indd 110 2014/4/2 上午 05:19:08
3.7 操作矩陣的行與列
|
111
你也許會需要新增元素、列向量或行向量。[Page-111]
新增行向量
新增列向量
討論說明
這種會改變輸入的破壞性操作應盡量避免,因為這很容易導致難找的錯誤。其一,這使
得程式碼對執行順序十分敏感;其次,你必須謹記這些操作是作用在符號上而不是串列
上。意指為何?讓我們檢查
AppendTo
指令的屬性。
ch03.indd 111 2014/4/2 上午 05:19:08
112
|
第三章
把重點放在
HoldFirst ...
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