or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Sage: 矩陣、線性方程組
This work by Jephian Lin is licensed under a Creative Commons Attribution 4.0 International License.
\(\newcommand{\trans}{^\top} \newcommand{\adj}{^{\rm adj}} \newcommand{\cof}{^{\rm cof}} \newcommand{\inp}[2]{\left\langle#1,#2\right\rangle} \newcommand{\dunion}{\mathbin{\dot\cup}} \newcommand{\bzero}{\mathbf{0}} \newcommand{\bone}{\mathbf{1}} \newcommand{\ba}{\mathbf{a}} \newcommand{\bb}{\mathbf{b}} \newcommand{\bc}{\mathbf{c}} \newcommand{\bd}{\mathbf{d}} \newcommand{\be}{\mathbf{e}} \newcommand{\bh}{\mathbf{h}} \newcommand{\bp}{\mathbf{p}} \newcommand{\bq}{\mathbf{q}} \newcommand{\br}{\mathbf{r}} \newcommand{\bx}{\mathbf{x}} \newcommand{\by}{\mathbf{y}} \newcommand{\bz}{\mathbf{z}} \newcommand{\bu}{\mathbf{u}} \newcommand{\bv}{\mathbf{v}} \newcommand{\bw}{\mathbf{w}} \newcommand{\tr}{\operatorname{tr}} \newcommand{\nul}{\operatorname{null}} \newcommand{\rank}{\operatorname{rank}} %\newcommand{\ker}{\operatorname{ker}} \newcommand{\range}{\operatorname{range}} \newcommand{\Col}{\operatorname{Col}} \newcommand{\Row}{\operatorname{Row}} \newcommand{\spec}{\operatorname{spec}} \newcommand{\vspan}{\operatorname{span}} \newcommand{\Vol}{\operatorname{Vol}} \newcommand{\sgn}{\operatorname{sgn}} \newcommand{\idmap}{\operatorname{id}} \newcommand{\am}{\operatorname{am}} \newcommand{\gm}{\operatorname{gm}} \newcommand{\mult}{\operatorname{mult}} \newcommand{\iner}{\operatorname{iner}}\)
建構矩陣
matrix( list of lists )
:把list of lists
中的每個list
當作矩陣的列。matrix(r, list)
:把list
切成r
個列。identity_matrix(n)
:單位矩陣。zero_matrix(n)
orzero_matrix(m,n)
:全零矩陣。利用
print
(純文字)或show
(格式化文字)來顯示矩陣。從矩陣中選取各項或子矩陣
若
A
是一個矩陣。A[i,j]
:選取第ij
項。A[list1, list2]
:選取列在 中行在 中的子矩陣。也可以混合使用﹐如
A[i, list]
或A[list, j]
。選取子矩陣中
list
的可以用a:b
的格式取代。a:b
:從a
到b
(不包含b
)。a:
:從a
到底。:b
:從頭到b
(不包含b
)。:
:全部。可以把選出來的子矩陣設定成給定的矩陣。
求解
若 為一矩陣﹐可以用
A.right_kernel()
或A.right_kernel().basis_matrix()
來找到零解的基底。
可以用
vector([list])
來設定向量。若
A
是矩陣而b
是向量﹐則
A \ b
會給出一組解。(也可以用
A.solve_right(b)
。)最簡階梯形式矩陣、增廣矩陣
若
A
為一矩陣﹐則A.rref()
會回傳其最簡階梯形式矩陣。若
A
為一矩陣而b
為一向量﹐則A.augment(b)
會回傳相對應的增廣矩陣。可以用以下函數對矩陣(或增廣矩陣)
A
執行列運算。A.swap_rows(i,j)
.A.rescale(i, k)
.A.add_multiple_of_row(i, j, k)
.注意這些函數會直接修改矩陣本身而不會回傳任何矩陣。
反矩陣
若
A
和B
都是矩陣﹐則A.augment(B)
也可以建立其相對應的增廣矩陣。藉此可以計算反矩陣。
若
A
是方陣﹐A.is_invertible()
可以判斷其是否可逆﹐A.inverse()
會求出它的逆矩陣。四大基礎子空間的標準基底
lingeo
是為這份教材所寫的函式庫。其內容包含在
lingeo.py
裡。可以用
來匯入須要的函數。
若
A
為一矩陣﹐則row_space_matrix(A)
的列是由 \(\beta_R\) 組成、kernel_matrix(A)
的行是由 \(\beta_K\) 組成、column_space_matrix(A)
的行是由 \(\beta_C\) 組成、left_kernel_matrix(A)
的列是由 \(\beta_L\) 組成。