FW: Default Format for Matrices
- To: mathgroup at smc.vnet.net
- Subject: [mg8446] FW: Default Format for Matrices
- From: Ersek_Ted%PAX1A at mr.nawcad.navy.mil
- Date: Sat, 30 Aug 1997 00:42:57 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Ealier today I said:
|
| It seems every time I have an output that is a matrix I type
| In[n]:= matrix//MatrixForm
|
| I want to make a rule for Format[] or MakeBoxes[]
| so that MatrixForm (or an equivalent) is used by default for
| Matrices with two or three columns
|
| I have some experience with Format and MakeBoxes,
| but I can't figure out this one.
|
| Any ideas greatly appreciated.
|
| Ted Ersek
|
Never mind I figured out how to do it.
I used the following:
MakeBoxes[m_?MatrixQ/; ( Dimensions[m] [[2]]<4 ), form_]:=
RowBox[{"(", GridBox[Map[MakeBoxes[#, form]&, m, {2}]],")"}]
Put this in your init.m
and your small matrices will look like matrices in the output !!
I also used Utilities`Notation`
to define the usual notation for Inverse and Transpose of a Matrix.
Ted Ersek