# Maple/矩陣與矢量

## 矢量

v1:=Vector([1,2,3,4]);

Vector(4, {(1) = 1, (2) = 2, (3) = 3, (4) = 4});

${\displaystyle {\begin{bmatrix}1\\2\\3\\4\end{bmatrix}}.}$

v2:=Vector([5,6,7,8]);

${\displaystyle {\begin{bmatrix}5\\6\\7\\8\end{bmatrix}}.}$

v1+v2;

${\displaystyle {\begin{bmatrix}6\\8\\10\\12\end{bmatrix}}.}$

10v1+10v2;

${\displaystyle {\begin{bmatrix}60\\80\\100\\120\end{bmatrix}}.}$

v3:=v2^*

${\displaystyle {\begin{bmatrix}5&6&7&8\end{bmatrix}}.}$

## 矩陣

A5:=Matrix(5,5, (i,j)-> j+(i-1)*5);

${\displaystyle {\begin{bmatrix}\\1&2&3&4&5\\6&7&8&9&10\\11&12&13&14&15\\16&17&18&19&20\\21&22&23&24&25\end{bmatrix}}.}$

A6=A5^*

${\displaystyle {\begin{bmatrix}\\1&6&11&16&21\\2&7&12&17&22\\3&8&13&18&23\\4&9&18&19&24\\5&10&15&20&25\end{bmatrix}}.}$

v6:=Vector([1,2,3,4,5])

${\displaystyle {\begin{bmatrix}1\\2\\3\\4\\5\end{bmatrix}}.}$

MatrixVectorMultiply(A5,v6);

${\displaystyle {\begin{bmatrix}\\55\\130\\205\\280\\355\end{bmatrix}}}$

MatrixScalarMultiply(A5, A6);

${\displaystyle {\begin{bmatrix}\\55&130&205&280&355\\130&330&530&730&930\\205&530&855&1180&1505\\280&730&1180&1630&2080\\355&930&1505&2080&2655\end{bmatrix}}.}$