# Is there a way to view all two-dimensional arrays in matrix form?

Is there a way to ensure that every time I perform an operation such as RowReduce, Linear Solve, Null Space, Inverse, Eigenvectors, etc. that the matrix is displaying in MatrixForm instead of applying the postfix form of MatrixForm every time (//MatrixForm)? For example, is there a variable in the Option Inspector to set the default form of an array? I checked but couldn't find anything of the sort. If not, I am going to make a feature request for a future release of Mathematica.

You can use $PrePrint: $PrePrint = If[MatrixQ @ #, MatrixForm @ #, #] &;

Array[x, {4, 5}]


{{a, b}, {x, y}}


SeedRandom[1];
rm = RandomInteger[10, {5, 5}]


N @ Eigenvectors[rm]


• How do create a global matrix preprint setting? It reverts back after I close the kernel. Dec 1 '21 at 1:20

An alternative is to teach StandardForm about your desired formatting:

Unprotect[StandardForm];
StandardForm /: MakeBoxes[l_List, StandardForm] /; MatrixQ @ Unevaluated @ l := MakeBoxes[MatrixForm[l]]
Protected[StandardForm];

• Is this to be applied in a notebook or init.m? Dec 6 '21 at 20:14
• That is up to you. Dec 6 '21 at 20:14
• My init.m changes are undone after I restart. How do I make permanent modifications? Dec 6 '21 at 20:27