# Palette for pasting matrix templates into a notebook

How I can build a palette of matrices?. So, I would like a palette with a 3x3 square matrix, a square matrix 4x4, 1x3 row matrix, 1x4 matrix row, column matrix 3x1 and 4x1 column matrix.

-

Using PasteButton with a matrix containing the desired matrix is one option.

PasteButton["3x3 Matrix", MatrixForm@( {
{\[Placeholder], \[Placeholder],\[Placeholder]},
{\[Placeholder], \[Placeholder],\[Placeholder]},
{\[Placeholder], \[Placeholder],\[Placeholder]}
} )]
PasteButton["1x3 Matrix", MatrixForm@( {
{\[Placeholder], \[Placeholder],\[Placeholder]}
} )]
PasteButton["3x1 Matrix", MatrixForm@( {
{\[Placeholder]}, {\[Placeholder]},{\[Placeholder]}
} )]


The 4x4, 1x4, and 4x1 matrices can be made in an analogous fashion. To put them in a palette:

CreatePalette[{PasteButton["3x3 Matrix",
MatrixForm@({{\[Placeholder], \[Placeholder], \[Placeholder]}, {\
\[Placeholder], \[Placeholder], \[Placeholder]}, {\[Placeholder], \
\[Placeholder], \[Placeholder]}})],
PasteButton["1x3 Matrix",
MatrixForm@({{\[Placeholder], \[Placeholder], \[Placeholder]}})],
PasteButton["3x1 Matrix",
MatrixForm@({{\[Placeholder]}, {\[Placeholder]}, \
{\[Placeholder]}})]}]

-

The "Basic Math Assistant" palette built into the last few versions does most of what you need, except that it starts from a 2 by 2 matrix and builds rows and columns from there.

-