% use the data generated by getdata and splineInterpolation
integral = zeros(size(xs));  % create vector of correct size

% perform a numerical integration by adding the contributions
% use a trapezoidal integration
for k = 2:length(xs)
    integral(k) = integral(k-1)+(xs(k)-xs(k-1))*(ys(k-1)+ys(k))/2;
endfor
figure(3);
axis(axislimits)
plot(xs,ys,"-+;function;",xs,integral,";integral;")
