% m53_series.m - Explore Fourier and Chebyshev series with Chebfun % FOURIER F = chebfun('cos(exp(sin(t)))', [-pi,pi], 'trig') subplot(1,2,1), plot(F,'.-') subplot(1,2,2), plotcoeffs(F,'.-') sum(F) roots(F) help cheb.gallerytrig F = cheb.gallerytrig('FMsignal') subplot(2,2,1), plot(F), ylim([-2 2]) subplot(2,2,3), plotcoeffs(F) F = cheb.gallerytrig('AMsignal') subplot(2,2,2), plot(F), ylim([-2 2]) subplot(2,2,4), plotcoeffs(F) % CHEBYSHEV f = chebfun('cos(exp(sin(x)))', [-pi,pi]) subplot(1,2,1), plot(f,'.-') subplot(1,2,2), plotcoeffs(f,'.-') sum(f) roots(f) help cheb.gallery f = cheb.gallery('zigzag') subplot(2,1,1), plot(f) subplot(2,1,2), plotcoeffs(f)