Re: MatrixForm affects values instead of only printing ?????
- To: mathgroup at smc.vnet.net
- Subject: [mg100327] Re: [mg100298] MatrixForm affects values instead of only printing ?????
- From: "David Park" <djmpark at comcast.net>
- Date: Mon, 1 Jun 2009 07:07:28 -0400 (EDT)
- References: <13516177.1243766422228.JavaMail.root@n11>
The documentation is either incorrect or misleading on the effect of MatrixForm. It certainly does affect how subsequent expressions are evaluated. But this is not all bad and one can learn how to use it. test2 = {-3, 7, 5} // MatrixForm test2 // FullForm Now, what about: test2.test2 % /. MatrixForm -> Identity Would you like the first dot product to evaluate, or would you prefer to see it in that form? Often, when I only want temporary MatrixForm display I write definitions with an extra pair of brackets: (test2 = {-3, 7, 5}) // MatrixForm test2[[3]] Part does work on the FullForm of the expression and considers any form wrappers as part of the expression. test3 = NumberForm[a + b + N[\[Pi]], 12] test3 // FullForm test3[[3]] test3[[1, 3]] Part[FullForm[a + b], 1, 2] I admit, this is all somewhat confusing, and the documentation is misleading. But it is manageable. Maybe someone else will give a clearer explanation. David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ From: summer [mailto:summertan at hotmail.com] Here is the example: test1={-3, 7, 5} test1[[3]] returns the list and 5 as expected; test2={-3, 7, 5}//MatrixForm test2[[3]] returns a column vector and error: "part 3 of blah blah doesn't exist". The actual list itself is test2[[1]]. To get the right 3rd element I have to do: test2[[1,3]] which returns 5 as expected. The problem is MatrixForm is NOT supposed to change the expression it is applied on according to the manual. Is that a bug or there's logical explanation?