How would I create an output similar to the result produced by this LaTeX code:
M = \bordermatrix{~ & x & y \cr
A & 1 & 0 \cr
B & 0 & 1 \cr}
which when compiled, looks like

|
|
|
This seems to work, at least for your example:
You can make a little function that generalises it:
So we have:
|
|||||||||||||
|