Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #9977 > unrolled thread

Re: Norm, Normalize and column vectors

Started byBill Rowe <readnews@sbcglobal.net>
First post2012-05-07 00:33 +0000
Last post2012-05-07 00:33 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Norm, Normalize and column vectors Bill Rowe <readnews@sbcglobal.net> - 2012-05-07 00:33 +0000

#9977 — Re: Norm, Normalize and column vectors

FromBill Rowe <readnews@sbcglobal.net>
Date2012-05-07 00:33 +0000
SubjectRe: Norm, Normalize and column vectors
Message-ID<jo758c$bt5$1@smc.vnet.net>
On 5/6/12 at 3:24 AM, brenttnewman@gmail.com (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]

>But

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

>Throws red

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

>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.



[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web