Hi,
welcome to the board!
If you use only LyX tools, you could use an array (like tabular) instead of a matrix. Internally matrices are array too. With an array you can use vertical lines.
If you would use LaTeX in LyX, the matrix environment could be extended. I write about this some time ago on my blog:
An extension to amsmath matrix environments.
In LyX it can be done by adding to the document preamble:
Code: Select all
\makeatletter
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
\hskip -\arraycolsep
\let\@ifnextchar\new@ifnextchar
\array{#1}}
\makeatother
Later you can use matrices with LaTeX (!) syntax, also in LyX (ERT):
Code: Select all
\begin{pmatrix}[cc|c]
1 & 2 & 3\\
4 & 5 & 9
\end{pmatrix}

- matrix1.png (1.86 KiB) Viewed 45027 times
Even more sophisticated, with color, adjusted spacing, bold font, right alignment:
Code: Select all
\begin{bmatrix}[*2cr@{\quad}|@{\quad}>{\bf\color{red}}r]
a & b & 1 & 4 \\
c & d & -2 & -3
\end{bmatrix}

- matrix2.png (1.89 KiB) Viewed 45027 times
You see you can use complex array column specifications.
Stefan