Re: Noob ? about Transpose and List Operations
- To: mathgroup at smc.vnet.net
- Subject: [mg63704] Re: Noob ? about Transpose and List Operations
- From: Bill Rowe <readnewsciv at earthlink.net>
- Date: Tue, 10 Jan 2006 01:49:00 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
On 1/9/06 at 4:48 AM, tarahw at umich.edu (Tarah) wrote: >In[61]:= B' = MatrixForm[Transpose[B]] >and instead of getting the transpose, I get as output the same >matrix B with two brackets and the word "Transpose" surrounding it. > This is highly unhelpful ;-) What am I doing wrong? Mathematica returns something unevaluated when it cannot determine the correct answer. Since Transpose is a built in function I am guessing you've not defined B, i.e., you did something like: In[1]:=Transpose[b] Out[1]=Transpose[b] Contrast this with: In[6]:=b = Table[10*i + j, {i, 3}, {j, 2}] Out[6]={{11, 12}, {21, 22}, {31, 32}} In[7]:=Transpose[b] Out[7]={{11, 21, 31}, {12, 22, 32}} A few other comments: It is better practice to not define variables beginning with capital letters. Although this is valid syntax in Mathematica, there is always a potential conflict with built-in symbols that always start with capital letters. By using lower case, you are certain to avoid any conflict with built-in symbols. Also, you almost certainly don't want b=MatrixForm[Transpose[...]]. This will give b the head MatrixForm, i.e., it will no longer be a matrix, i.e., In[12]:= c=MatrixForm[Transpose[b]]; MatrixQ[c] Out[13]=False If you want to use MatrixForm for display purposes it would be better to do things as MatrixForm[b=Transpose[...]] Now b is a matrix and the display will be controlled by MatrixForm, i.e., In[14]:= MatrixForm[c=Transpose[b]]; MatrixQ[c] Out[15]=True Even better would be to dispense with MatrixForm altogether and set the default output to TraditionalForm. -- To reply via email subtract one hundred and four