首先声明矩阵的构建运算均在numpy模块中由相应的函数,而本文的目的主要是因为闲的无聊
文章目录
矩阵及其运算
什么是矩阵?
由m×nm{\times}nm×n个 aija_{ij}aij(i=1,2,⋯{\cdots}⋯,m;j=1,2,⋯{\cdots}⋯,n) 数排列成的m行n列的数表
A=[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn]记作Am∗nA=\begin{bmatrix}
{a_{11}} & {a_{12}} & {\cdots} & {a_{1n}}\\
{a_{21}} & {a_{22}} & {\cdots} & {a_{2n}}\\
{\vdots} & {\vdots} & {\ddots} & {\vdots}\\
{a_{m1}} & {a_{m2}} & {\cdots} & {a_{mn}}\\
\end{bmatrix}记作{A_{m*n}}A=⎣⎢⎢⎢⎡a11a21⋮am1a12a22⋮am2⋯⋯⋱⋯a1na2n⋮amn⎦⎥⎥⎥⎤记作Am∗n
这m×n个数称为矩阵A的元素(元)
矩阵基本运算
加法
两个m×nm{\times}nm×n的矩阵相加,即对应元素相加
[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn]+[b11b12⋯b1nb21b22⋯b2n⋮⋮⋱⋮bm1bm2⋯bmn]=[a11+b11a12+b12⋯a1n+b1na21+b21a22+b22⋯a2n+b2n⋮⋮⋱⋮am1+bm1am2+bm2⋯amn+bmn]\begin{bmatrix}
{a_{11}} & {a_{12}} & {\cdots} & {a_{1n}}\\
{a_{21}} & {a_{22}} & {\cdots} & {a_{2n}}\\
{\vdots} & {\vdots} & {\ddots} & {\vdots}\\
{a_{m1}} & {a_{m2}} & {\cdots} & {a_{mn}}\\
\end{bmatrix}+
\begin{bmatrix}
{b_{11}} & {b_{12}} & {\cdots} & {b_{1n}}\\
{b_{21}} & {b_{22}} & {\cdots} & {b_{2n}}\\
{\vdots} & {\vdots} & {\ddots} & {\vdots}\\
{b_{m1}} & {b_{m2}} & {\cdots} & {b_{mn}}\\
\end{bmatrix}=
\begin{b