So far this is what i did but i dont know how to call a function, can anyone help?
function [C,X,Y] = Chebyshev( func, N, a, b )
X=(b+a-(b-a)*cos((2*(0:N-1)+1)*pi/(2*N)))/2;
Y = eval(func,X);
C=zeros(1,N+1);
call function as
[C,X,Y] = Chebyshev( ['cos(X)'], 2, -1, 1)