% Control1_2.m
% Exercise 2 of control 1, 30/10/2015
% Find and plot Leibnitz series for pi/4
% J.M.Soler, Oct.2015

clear all
Lmax = 100;                        % max. number of terms
n = 1:Lmax;                        % we use n beacause l looks like 1 (one)
f = 1+cumsum((-1).^n./(2*n+1));    % 1 is the n=0 term
pi4 = pi/4*ones(size(n));
figure(11)
plot( n,f, n,pi4 );
legend('f(L)','\pi/4')
xlabel('L');
ylabel('series');
