\begin{patch}{ExMatrixBasicFunctionPatch1}
\begin{paste}{ExMatrixBasicFunctionFull1}{ExMatrixBasicFunctionEmpty1}
\pastebutton{ExMatrixBasicFunctionFull1}{\hidepaste}
\tab{5}\spadcommand{m1 := matrix([[1,-2,1],[4,2,-4]])\bound{m1 }}
\indentrel{3}\begin{verbatim}
        +1  - 2   1 +
   (1)  |           |
        +4   2   - 4+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty1}
\begin{paste}{ExMatrixBasicFunctionEmpty1}{ExMatrixBasicFunctionPatch1}
\pastebutton{ExMatrixBasicFunctionEmpty1}{\showpaste}
\tab{5}\spadcommand{m1 := matrix([[1,-2,1],[4,2,-4]])\bound{m1 }}
\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionPatch2}
\begin{paste}{ExMatrixBasicFunctionFull2}{ExMatrixBasicFunctionEmpty2}
\pastebutton{ExMatrixBasicFunctionFull2}{\hidepaste}
\tab{5}\spadcommand{m2 := matrix([[1,0,2],[20,30,10],[0,200,100]])\bound{m2 }}
\indentrel{3}\begin{verbatim}
        +1    0    2 +
        |            |
   (2)  |20  30   10 |
        |            |
        +0   200  100+
                       Type: Matrix(NonNegativeInteger)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty2}
\begin{paste}{ExMatrixBasicFunctionEmpty2}{ExMatrixBasicFunctionPatch2}
\pastebutton{ExMatrixBasicFunctionEmpty2}{\showpaste}
\tab{5}\spadcommand{m2 := matrix([[1,0,2],[20,30,10],[0,200,100]])\bound{m2 }}
\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionPatch3}
\begin{paste}{ExMatrixBasicFunctionFull3}{ExMatrixBasicFunctionEmpty3}
\pastebutton{ExMatrixBasicFunctionFull3}{\hidepaste}
\tab{5}\spadcommand{m3 := matrix([[1,2,3],[2,4,6]])\bound{m3 }}
\indentrel{3}\begin{verbatim}
        +1  2  3+
   (3)  |       |
        +2  4  6+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty3}
\begin{paste}{ExMatrixBasicFunctionEmpty3}{ExMatrixBasicFunctionPatch3}
\pastebutton{ExMatrixBasicFunctionEmpty3}{\showpaste}
\tab{5}\spadcommand{m3 := matrix([[1,2,3],[2,4,6]])\bound{m3 }}
\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionPatch4}
\begin{paste}{ExMatrixBasicFunctionFull4}{ExMatrixBasicFunctionEmpty4}
\pastebutton{ExMatrixBasicFunctionFull4}{\hidepaste}
\tab{5}\spadcommand{m1 + m3\free{m1 }\free{m3 }}
\indentrel{3}\begin{verbatim}
        +2  0  4+
   (4)  |       |
        +6  6  2+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty4}
\begin{paste}{ExMatrixBasicFunctionEmpty4}{ExMatrixBasicFunctionPatch4}
\pastebutton{ExMatrixBasicFunctionEmpty4}{\showpaste}
\tab{5}\spadcommand{m1 + m3\free{m1 }\free{m3 }}
\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionPatch5}
\begin{paste}{ExMatrixBasicFunctionFull5}{ExMatrixBasicFunctionEmpty5}
\pastebutton{ExMatrixBasicFunctionFull5}{\hidepaste}
\tab{5}\spadcommand{100 * m1\free{m1 }}
\indentrel{3}\begin{verbatim}
        +100  - 200   100 +
   (5)  |                 |
        +400   200   - 400+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty5}
\begin{paste}{ExMatrixBasicFunctionEmpty5}{ExMatrixBasicFunctionPatch5}
\pastebutton{ExMatrixBasicFunctionEmpty5}{\showpaste}
\tab{5}\spadcommand{100 * m1\free{m1 }}
\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionPatch6}
\begin{paste}{ExMatrixBasicFunctionFull6}{ExMatrixBasicFunctionEmpty6}
\pastebutton{ExMatrixBasicFunctionFull6}{\hidepaste}
\tab{5}\spadcommand{m1 * m2\free{m1 }\free{m2 }}
\indentrel{3}\begin{verbatim}
        +- 39   140    82  +
   (6)  |                  |
        + 44   - 740  - 372+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty6}
\begin{paste}{ExMatrixBasicFunctionEmpty6}{ExMatrixBasicFunctionPatch6}
\pastebutton{ExMatrixBasicFunctionEmpty6}{\showpaste}
\tab{5}\spadcommand{m1 * m2\free{m1 }\free{m2 }}
\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionPatch7}
\begin{paste}{ExMatrixBasicFunctionFull7}{ExMatrixBasicFunctionEmpty7}
\pastebutton{ExMatrixBasicFunctionFull7}{\hidepaste}
\tab{5}\spadcommand{-m1 + m3 * m2\free{m1 }\free{m2 }\free{m3 }}
\indentrel{3}\begin{verbatim}
        +40  662   321+
   (7)  |             |
        +78  1318  648+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty7}
\begin{paste}{ExMatrixBasicFunctionEmpty7}{ExMatrixBasicFunctionPatch7}
\pastebutton{ExMatrixBasicFunctionEmpty7}{\showpaste}
\tab{5}\spadcommand{-m1 + m3 * m2\free{m1 }\free{m2 }\free{m3 }}
\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionPatch8}
\begin{paste}{ExMatrixBasicFunctionFull8}{ExMatrixBasicFunctionEmpty8}
\pastebutton{ExMatrixBasicFunctionFull8}{\hidepaste}
\tab{5}\spadcommand{m3 *vector([1,0,1])\free{m3 }}
\indentrel{3}\begin{verbatim}
   (8)  [4, 8]
                                  Type: Vector(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExMatrixBasicFunctionEmpty8}
\begin{paste}{ExMatrixBasicFunctionEmpty8}{ExMatrixBasicFunctionPatch8}
\pastebutton{ExMatrixBasicFunctionEmpty8}{\showpaste}
\tab{5}\spadcommand{m3 *vector([1,0,1])\free{m3 }}
\end{paste}\end{patch}

\begin{patch}{ExRankMatrixPatch1}
\begin{paste}{ExRankMatrixFull1}{ExRankMatrixEmpty1}
\pastebutton{ExRankMatrixFull1}{\hidepaste}
\tab{5}\spadcommand{rank(matrix([[0,4,1],[5,3,-7],[-5,5,9]]))}
\indentrel{3}\begin{verbatim}
   (1)  2
                                  Type: PositiveInteger
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExRankMatrixEmpty1}
\begin{paste}{ExRankMatrixEmpty1}{ExRankMatrixPatch1}
\pastebutton{ExRankMatrixEmpty1}{\showpaste}
\tab{5}\spadcommand{rank(matrix([[0,4,1],[5,3,-7],[-5,5,9]]))}
\end{paste}\end{patch}

\begin{patch}{ExTraceMatrixPatch1}
\begin{paste}{ExTraceMatrixFull1}{ExTraceMatrixEmpty1}
\pastebutton{ExTraceMatrixFull1}{\hidepaste}
\tab{5}\spadcommand{trace( matrix([[1,x,x^2,x^3],[1,y,y^2,y^3],[1,z,z^2,z^3],[1,u,u^2,u^3]]) )}
\indentrel{3}\begin{verbatim}
         2        3
   (1)  z  + y + u  + 1
                              Type: Polynomial(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExTraceMatrixEmpty1}
\begin{paste}{ExTraceMatrixEmpty1}{ExTraceMatrixPatch1}
\pastebutton{ExTraceMatrixEmpty1}{\showpaste}
\tab{5}\spadcommand{trace( matrix([[1,x,x^2,x^3],[1,y,y^2,y^3],[1,z,z^2,z^3],[1,u,u^2,u^3]]) )}
\end{paste}\end{patch}

\begin{patch}{ExInverseMatrixPatch1}
\begin{paste}{ExInverseMatrixFull1}{ExInverseMatrixEmpty1}
\pastebutton{ExInverseMatrixFull1}{\hidepaste}
\tab{5}\spadcommand{inverse(matrix([[1,2,1],[-2,3,4],[-1,5,6]]))}
\indentrel{3}\begin{verbatim}
        +  2        5 +
        |- -  - 1   - |
        |  7        7 |
        |             |
   (1)  | 8          6|
        | -    1   - -|
        | 7          7|
        |             |
        +- 1  - 1   1 +
             Type: Union(Matrix(Fraction(Integer)),...)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExInverseMatrixEmpty1}
\begin{paste}{ExInverseMatrixEmpty1}{ExInverseMatrixPatch1}
\pastebutton{ExInverseMatrixEmpty1}{\showpaste}
\tab{5}\spadcommand{inverse(matrix([[1,2,1],[-2,3,4],[-1,5,6]]))}
\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixPatch1}
\begin{paste}{ExConstructMatrixFull1}{ExConstructMatrixEmpty1}
\pastebutton{ExConstructMatrixFull1}{\hidepaste}
\tab{5}\spadcommand{diagonalMatrix([1,2,3,2,1])}
\indentrel{3}\begin{verbatim}
        +1  0  0  0  0+
        |             |
        |0  2  0  0  0|
        |             |
   (1)  |0  0  3  0  0|
        |             |
        |0  0  0  2  0|
        |             |
        +0  0  0  0  1+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixEmpty1}
\begin{paste}{ExConstructMatrixEmpty1}{ExConstructMatrixPatch1}
\pastebutton{ExConstructMatrixEmpty1}{\showpaste}
\tab{5}\spadcommand{diagonalMatrix([1,2,3,2,1])}
\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixPatch2}
\begin{paste}{ExConstructMatrixFull2}{ExConstructMatrixEmpty2}
\pastebutton{ExConstructMatrixFull2}{\hidepaste}
\tab{5}\spadcommand{subMatrix(matrix([[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14]]), 1,3,2,4)}
\indentrel{3}\begin{verbatim}
        +1   2   3 +
        |          |
   (2)  |6   7   8 |
        |          |
        +11  12  13+
                       Type: Matrix(NonNegativeInteger)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixEmpty2}
\begin{paste}{ExConstructMatrixEmpty2}{ExConstructMatrixPatch2}
\pastebutton{ExConstructMatrixEmpty2}{\showpaste}
\tab{5}\spadcommand{subMatrix(matrix([[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14]]), 1,3,2,4)}
\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixPatch3}
\begin{paste}{ExConstructMatrixFull3}{ExConstructMatrixEmpty3}
\pastebutton{ExConstructMatrixFull3}{\hidepaste}
\tab{5}\spadcommand{horizConcat(matrix([[1,2,3],[6,7,8]]),matrix([[11,12,13],[55,77,88]]))}
\indentrel{3}\begin{verbatim}
        +1  2  3  11  12  13+
   (3)  |                   |
        +6  7  8  55  77  88+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixEmpty3}
\begin{paste}{ExConstructMatrixEmpty3}{ExConstructMatrixPatch3}
\pastebutton{ExConstructMatrixEmpty3}{\showpaste}
\tab{5}\spadcommand{horizConcat(matrix([[1,2,3],[6,7,8]]),matrix([[11,12,13],[55,77,88]]))}
\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixPatch4}
\begin{paste}{ExConstructMatrixFull4}{ExConstructMatrixEmpty4}
\pastebutton{ExConstructMatrixFull4}{\hidepaste}
\tab{5}\spadcommand{vertConcat(matrix([[1,2,3],[6,7,8]]),matrix([[11,12,13],[55,77,88]]))}
\indentrel{3}\begin{verbatim}
        +1   2   3 +
        |          |
        |6   7   8 |
   (4)  |          |
        |11  12  13|
        |          |
        +55  77  88+
                                  Type: Matrix(Integer)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixEmpty4}
\begin{paste}{ExConstructMatrixEmpty4}{ExConstructMatrixPatch4}
\pastebutton{ExConstructMatrixEmpty4}{\showpaste}
\tab{5}\spadcommand{vertConcat(matrix([[1,2,3],[6,7,8]]),matrix([[11,12,13],[55,77,88]]))}
\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixPatch5}
\begin{paste}{ExConstructMatrixFull5}{ExConstructMatrixEmpty5}
\pastebutton{ExConstructMatrixFull5}{\hidepaste}
\tab{5}\spadcommand{b:=matrix([[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14]])\bound{b }}
\indentrel{3}\begin{verbatim}
        +0   1   2   3   4 +
        |                  |
   (5)  |5   6   7   8   9 |
        |                  |
        +10  11  12  13  14+
                       Type: Matrix(NonNegativeInteger)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixEmpty5}
\begin{paste}{ExConstructMatrixEmpty5}{ExConstructMatrixPatch5}
\pastebutton{ExConstructMatrixEmpty5}{\showpaste}
\tab{5}\spadcommand{b:=matrix([[0,1,2,3,4],[5,6,7,8,9],[10,11,12,13,14]])\bound{b }}
\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixPatch6}
\begin{paste}{ExConstructMatrixFull6}{ExConstructMatrixEmpty6}
\pastebutton{ExConstructMatrixFull6}{\hidepaste}
\tab{5}\spadcommand{setsubMatrix!(b,1,1,transpose(subMatrix(b,1,3,1,3)))\free{b }}
\indentrel{3}\begin{verbatim}
        +0  5  10  3   4 +
        |                |
   (6)  |1  6  11  8   9 |
        |                |
        +2  7  12  13  14+
                       Type: Matrix(NonNegativeInteger)
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExConstructMatrixEmpty6}
\begin{paste}{ExConstructMatrixEmpty6}{ExConstructMatrixPatch6}
\pastebutton{ExConstructMatrixEmpty6}{\showpaste}
\tab{5}\spadcommand{setsubMatrix!(b,1,1,transpose(subMatrix(b,1,3,1,3)))\free{b }}
\end{paste}\end{patch}

\begin{patch}{ExDeterminantMatrixPatch1}
\begin{paste}{ExDeterminantMatrixFull1}{ExDeterminantMatrixEmpty1}
\pastebutton{ExDeterminantMatrixFull1}{\hidepaste}
\tab{5}\spadcommand{determinant(matrix([[1,2,3,4],[2,3,2,5],[3,4,5,6],[4,1,6,7]]))}
\indentrel{3}\begin{verbatim}
   (1)  - 48
                                          Type: Integer
\end{verbatim}
\indentrel{-3}\end{paste}\end{patch}

\begin{patch}{ExDeterminantMatrixEmpty1}
\begin{paste}{ExDeterminantMatrixEmpty1}{ExDeterminantMatrixPatch1}
\pastebutton{ExDeterminantMatrixEmpty1}{\showpaste}
\tab{5}\spadcommand{determinant(matrix([[1,2,3,4],[2,3,2,5],[3,4,5,6],[4,1,6,7]]))}
\end{paste}\end{patch}

