Ideally students would copy and past the matrices and add required brackets in MATLAB.

I was able to generate matrices for copy-paste on the screen (on MacOS) only with the command display_matrix($A)

Other things I tried did not work, including display_matrix_mm($A) or PGML code. The resulting matrices had too many garbage around them, or were displayed in a row, and usually negative signs became hyphens.

display_matrix($A) would be fine for me, except what is the deal with the unusually large space before the last row on the screen?

Any suggestions other than display_matrix($A) for displaying matrices that can be copy-pasted?