title: Taylor Series of ln(x) in Matlab
body: <p>I am trying to compute the taylor series of ln(x) for any value of x.</p>
  
  <p>What I have so far is:</p>
  
  <pre><code> clear
   clc
   n = input('Enter number of iiterations (n): ' );
   x = input('enter value of x (x): ');
   y = zeros(1,n);
   for i = 0:n
    y(i+1)=sum + (-1)^(n+1)*(x-1)^n/n;
  end
  </code></pre>
  
  <p>But this code seems to be broken and I can't figure out why. Any suggestions on how to improve?</p>