MathGroup Archive 2012

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

Search the Archive

Re: Norm, Normalize and column vectors

On 5/6/12 at 3:24 AM, brenttnewman at (Brentt) wrote:

>Why does Norm work with column vectors, but Normalize does not?

>e.g.. In[1]:= Norm[{{1}, {2}, {3}}]

>Out[1]= Sqrt[14]


>In[2]:=Normalize[{{1}, {2}, {3}}]

>Throws red

>It even says in the documentation that Normalize[v] essentially

>Times[Power[Norm[v],-1],v],   except returning the 0 vector for the
>0 vector. Strangely, the above "equivalent" expression would handle
>all but th 0 column vector with aplomb.

>I find this curious. Is there a good explanation for this?

Mathematica has no concept of row/column vectors. A vector in
Mathematica is a 1-d list. That is:

In[1]:= a = Range[3];
{VectorQ[a], MatrixQ[a]}

Out[2]= {True,False}

In[3]:= {VectorQ[{a}], MatrixQ[{a}]}

Out[3]= {False,True}

In[4]:= {VectorQ[List /@ a], MatrixQ[List /@ a]}

Out[4]= {False,True}

The documentation specifically states Normalize works with
vectors, not matrices. Norm works with matrices. What you a
row/column vector is a matrix in Mathematica.

  • Prev by Date: Re: New to Mathematica
  • Next by Date: Re: Norm, Normalize and column vectors
  • Previous by thread: Re: Norm, Normalize and column vectors
  • Next by thread: KeyUp event