% Show the results of MyCosSeries_comp.m
%
% Samuli Siltanen Nov 2014

% Load precomputed results from file
load MyCosSeries approx_mat y N

% Take a look at the result
for nnn = 0:N
    figure(1)
    clf
    % Plot the original function and
    % the current approximation
    subplot(2,1,1)
    plot(y,MyFun4(y),'k')
    hold on
    plot(y,approx_mat(:,nnn+1),'r')
    axis([0 2*pi -1.5 1.5])
    
    subplot(2,1,2)
    plot(y,cos(nnn*y),'r')
    axis([0 2*pi -1.5 1.5])
    
    pause
end