title: How to normalize a vector with negative values using matlab?
body: <p>For a given vector, say <code>v=[1 2 2]</code>, I need to normalize and the sum of all values in the resultant matrix must be 1. Then I am using the matlab code as <code>w=v/norm(v,1)</code>. Now the result <code>w=[0.2000 0.4000 0.4000]</code> i.e. <code>sum=0.2+0.4+0.4=1</code> and the condition is satisfied. But when using a negative value, the result is wrong. i.e. if <code>v=[1 -2 2]</code> and <code>w=v/norm(v,1)</code>. Now the result is <code>w=[0.2000 -0.4000 0.4000]</code> and <code>sum = 0.2+(-0.4)+0.4 != 1</code>.This sum is not equal to one. Then am using <code>w=abs(v)/norm(v,1)</code>. Is this correct?</p>