Re: Row or column?
- To: mathgroup at smc.vnet.net
- Subject: [mg112686] Re: Row or column?
- From: Leonid Shifrin <lshifr at gmail.com>
- Date: Mon, 27 Sep 2010 05:45:34 -0400 (EDT)
Hi Sam,
MatrixForm is set up so that it works on vectors as well, not just matrices.
Now, {a,b} is not a matrix - it's a vector.
In[19]:= Dimensions[{a, b}]
Out[19]= {2}
Similar output appearance should not deceive you. This will be the 1x2
matrix you seek:
{{a,b}}
In[20]:= Dimensions[{{a, b}}]
Out[20]= {1, 2}
Regards,
Leonid
On Sun, Sep 26, 2010 at 10:44 AM, Sam Takoy <sam.takoy at yahoo.com> wrote:
> Hi,
>
> How come
>
> {a, b} // MatrixForm
> {{a}, { b}} // MatrixForm
>
> produce identical outputs: columns?
>
> I would think that the first "matrix" is 1x2 and the second is 2x1.
>
> Alternatively, how do I produce a 1x2 matrix?
>
> Many thanks in advance,
>
> Sam
>
>