Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: $Post

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67444] Re: $Post
  • From: Peter Pein <petsie at dordos.net>
  • Date: Sun, 25 Jun 2006 03:19:03 -0400 (EDT)
  • References: <e7j0ta$7ol$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Bruce Colletti schrieb:
> $Post = N displays all numeric output in digit form.  Thus, sqrt(2) appears as 1.4142.
> 
> Likewise, $Post = If[MatrixQ@#, MatrixForm@#] & causes all matrices to appear as matrices.
> 
> Unfortunately, I don't see how to establish both at once.  How would I do this?
> 
> Thanx.
> 
> Bruce
> 
In[1]:=
$Post=N@If[MatrixQ@#,MatrixForm@#,#]&;

In[2]:= Sqrt[2]
Out[2]= 1.41421
In[3]:= {{Sqrt[2]}}
Out[3]//MatrixForm= (1.41421)

does not do what you expect?

To get results close to the exact values in less trivial cases, I would recommend N[If[...],16] instead of N at If[...].

Peter


  • Prev by Date: Re: $Post
  • Next by Date: NIntegrate's Method ->Oscillatory option
  • Previous by thread: RE:$Post
  • Next by thread: Listing ALL Options for a mathematica Function