Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9977 > unrolled thread
| Started by | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| First post | 2012-05-07 00:33 +0000 |
| Last post | 2012-05-07 00:33 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Norm, Normalize and column vectors Bill Rowe <readnews@sbcglobal.net> - 2012-05-07 00:33 +0000
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Date | 2012-05-07 00:33 +0000 |
| Subject | Re: 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.
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web