No BSD License  

Highlights from
ChebyshevTools

from ChebyshevTools by Michael Watson
Tool box for solving ODE/PDEs using spectral Chebyshev differentiation matrices.

y=cheb2phys(F);
function y=cheb2phys(F);

% Written by Mike Watson, November 29
% takes a real vector of normalized Chebyshev spectral coeffients F and outputs
% the physical coefficients f on the interval [-1,1]


N=length(F);

if (N==1)
    y=F;
else
    F_even=(N-1).*[F;flipud(F(2:N-1))];  % create an even extension of F, including Nyquist;
    % and renormalize
    F_even(1)=F_even(1)*2;
    F_even(N)=F_even(N)*2;

    f=real(ifft(F_even));  %perform a discrete cosine transform (DCT);

    y=f(1:N);

end

Contact us at files@mathworks.com