title: Sampling and DTFT in Matlab
body: <p>I need to produce a signal x=-2*cos(100*pi*n)+2*cos(140*pi*n)+cos(200*pi*n)
  So I put it like this :</p>
  
  <pre><code>N=1024;
  for n=1:N
      x=-2*cos(100*pi*n)+2*cos(140*pi*n)+cos(200*pi*n);
  end
  </code></pre>
  
  <p>But What I get is that the result keeps giving out 1
  I tried to test each values according to each n, and I get the same results for any n
  For example -2*cos(100*pi*n) with n=1 has to be -1.393310473. Instead of that, Matlab gave the result -2 for it and it always gave -2 for any n
  I don't know how to fix it, so I hope someone could help me out! Thank you!</p>