Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9977
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Norm, Normalize and column vectors |
| Date | 2012-05-07 00:33 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jo758c$bt5$1@smc.vnet.net> (permalink) |
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 comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Norm, Normalize and column vectors Bill Rowe <readnews@sbcglobal.net> - 2012-05-07 00:33 +0000
csiph-web