title: Drawing a line based on matrix coordinates
body: <p>My teacher told us to use matlab to calculate the svd of a matrix. This is what I have done so far:</p>
  
  <pre><code>X=0:0.01:0.9; 
  Y=5*X+randn(size(X));
  
  A = [[X.'], [Y.']]
  
  [U,S,V] = svd(A)
  
  plot(X,Y,'ok')
  
  
  L1 = [0 0]
  L2 = [V(1,1) V(1,2)]
  
  hold on
  line (L1, L2)
  hold off
  </code></pre>
  
  <p>I have generated some (almost) random points, Then I put them in a matrix and then I calculated the svd. The problem is that I cant visualize the <code>V</code> matrix. The line from (0,0) to (v[1,1] , v[1 2]) should be in the direction that the density of the data is the most. The V matrix looks fine here, When I draw the line from origin to (v[1,1] , v[1 2]) using pen and paper everything looks fine, But when I use <code>line</code> to create a line between these two points I dont get my desired line, the line looks like this: </p>
  
  <p><a href="https://i.stack.imgur.com/dSU1g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dSU1g.png" alt="enter image description here"></a></p>