3
$\begingroup$

This question already has an answer here:

There seems to be a difference in the way Mathematica assigns a value to a variable and the way it assigns a value to the next Out object. I don't understand why this is happening.

For instance, take the following command:

In[1]=

          Pi // MatrixForm

Out[1]//MatrixForm=

          Pi

Why does the console say "Out[1] // MatrixForm"? I would have expected Mathematica to evaluate the entire line of input and assign the value to the Out[1] object. Instead, it seems to have ignored the MatrixForm command and instead apply it to the output that was printed.

Let me explicitly assign a variable this value (as opposed to implicitly assigning the value to Out):

In[2]=

          m = Pi // MatrixForm

Out[2]//MatrixForm=

          Pi

Now if I look at the difference between Out[2] and m:

In[3]=

          m // FullForm
          Out[2] //FullForm

Out[3]//FullForm=

          MatrixForm[Pi]

Out[4]//FullForm=

          Pi

I had assumed that Mathematica would assign the Out object the exact same value as the m object but this does not appear to be the case. What is the explanation for this? How is Out treated differently, and why?

$\endgroup$

merged by Mr.Wizard Mar 19 '15 at 14:59

This question was merged with Head of a MatrixForm expression? because it is an exact duplicate of that question.