MathGroup Archive 2009

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

Search the Archive

Re: MatrixForm affects values instead of only printing ?????

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100313] Re: MatrixForm affects values instead of only printing ?????
  • From: Simon <simonjtyler at gmail.com>
  • Date: Mon, 1 Jun 2009 07:04:50 -0400 (EDT)
  • References: <gvtmh7$ggc$1@smc.vnet.net>

You're right about this behaviour, and in fact it holds for any of the
*Form "wrappers".  eg

test3={-3,7,5}//FullForm
test3[[3]]

but, for example

test2={-3,7,5}//MatrixForm
%[[3]]

behaves as you'd expect.  The wrapper really doesn't affect the
evaluation. The "problem" is that the postfix operation takes
precedence over the Set (=) thus these inputs are interpreted as (eg)

Set[test2, MatrixForm[List[-3,7,5]]]

and in some cases you really do want this, which is why it's the
behaviour of Mathematica.
So, you just have to be careful and enforce the order of operations by
using expressions such as

(test2={-3,7,5})//MatrixForm
test2[[3]]

Simon

PS -- I'm interested in seeing if there's a better explanation than
this.


  • Prev by Date: Re: MatrixForm affects values instead of only printing ?????
  • Next by Date: Re: MatrixForm affects values instead of only printing
  • Previous by thread: Re: MatrixForm affects values instead of only printing ?????
  • Next by thread: Re: MatrixForm affects values instead of only printing ?????