title: Why am I getting ones when evaluating the runge function at chebyshev points?
body: <p>I cannot understand why my output y is all 1's. Please help, I've been staring at this for hours. It works perfectly in another similar program where I choose equally spaced points.</p>
  
  <pre><code>function [t,y] = chebyshev(n)
  
  format long
  
  for k = 1:1:n
      r = ((2*k - 1)*pi)/2*n;
      t(k,1) = cos(r);
  end
  
  for j = 1:1:n
      y(j,1) = (1/(1 + (25*(t(j,1)^2))));
  end
  figure(3)
  plot(t,y);
  </code></pre>