function out=fN(x,N) % % computes the Nth partial sum of the fourier series for f(x) % out=zeros(size(x)); % initialize output L=x(end); a0=1; % for a0 out=out + a0/2; fprintf('\n Adding...(to %d)',N); % print statement for n=1:N fprintf('..%d',n); % print statement k=2*n-1; an=0; bn=2/(k*pi); out = out + an*cos(k*pi*x/L) + bn*sin(k*pi*x/L); end fprintf('\n'); % print statement