Re: Automatic Display in MatrixForm

*To*: mathgroup at smc.vnet.net*Subject*: [mg19503] Re: Automatic Display in MatrixForm*From*: colin at tri.org.au (Colin Rose)*Date*: Sat, 28 Aug 1999 15:53:22 -0400*Organization*: Theoretical Research Institute*References*: <7p00rp$76g@smc.vnet.net> <7p30am$aos@smc.vnet.net> <7ps4js$joc@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Dave Withoff apparently suggested: MakeBoxes[m_?(Function[t,MatrixQ[Unevaluated[t]]&&(t=!={{}}),HoldAll]), StandardForm] := RowBox[{"(", GridBox[Map[Function[t,MakeBoxes[t,StandardForm],HoldAll], Unevaluated[m],{2}]],")"}] Two interesting cases are: (1) Output from Solve will now get displayed as a 'Matrix', which I think is highly undesirable. For instance, if Solve returns an answer such as {{x -> 3}} then it will now be presented as (x -> 3) which can cause a lot of confusion. I would suggest eliminating this possibilility by adding the exclusion rule: FreeQ[t, Rule] === True to yield Function[t, MatrixQ[Unevaluated[t]] && (t =!= {{}} && FreeQ[t, Rule] === True), HoldAll] (2). Let: lis = { {}, {}, {}, {} ... } Some functions might generate output like this. This generates a BEEP when Mathematica tries to format it as a "Matrix". I can't think of a nice general way to exclude such cases. Cheers Colin -- Colin Rose tr(I) - Theoretical Research Institute __________________________________________ colin at tri.org.au http://www.tri.org.au/