title: Taylor series for cos(x) in matlab
body: <p><strong>I have a simple question. I want to write Taylor series expansion for cos(x).</strong>
  <strong>And I wrote that codes</strong></p>
  
  <pre><code>x=input('Please input an angle in degrees: ');
  cosx=1;
  for i=1:1:x
  addterm = (-1)^i*(x.^(2*i))/factorial(2*i);
  cosx = cosx + addterm;
  end
   a=['The value of cosine of ',num2str(x),' degrees is ', num2str(cosx)];
   disp(a)
  </code></pre>
  
  <p><strong>But that code did not give true result.Why?</strong></p>