function c=cheb_nodes(a,b,n) x=[]; for k=0:n-1 x=[x,-cos(pi*k/(n-1))]; end x=x.*(b-a)/2 + (b+a)/2; c=x;