MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Automatic Display in MatrixForm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19291] Re: Automatic Display in MatrixForm
  • From: Bruno Daniel <bruno.daniel at hadiko.de>
  • Date: Thu, 12 Aug 1999 22:34:46 -0400
  • Organization: University of Karlsruhe
  • References: <7ook1l$i37@smc.vnet.net> <7or5bt$14h@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi mates!

I learned from David Withoff that it's much better to use $PrePrint
instead of $Post for this purpose, since the latter might influence
the values assigned to Out[i] and %i.

So this is what I put into my init.m:

--------------------------------------------------------------------
(* Matrices having at most "rows" rows and at most "columns" columns
   are displayed in MatrixForm *)
switchMatrixForm[rows_,columns_]:= (
  $PrePrint = If[MatrixQ[#] && Length[#]<=rows &&                 
                 Dimensions[#][[2]]<=columns,
                 MatrixForm[#],#]&
)

switchMatrixForm[18,7]
--------------------------------------------------------------------

You can switch it off or change the limits for the rows and columns
by using switchMatrixForm in your Mathematica session.

Yours sincerely
  Bruno


  • Prev by Date: Re: Re: Automatic Display in MatrixForm
  • Next by Date: Re: Short Doesn't Work
  • Previous by thread: Re: Re: Automatic Display in MatrixForm
  • Next by thread: Re: Automatic Display in MatrixForm