% Trying out Riemannian integration numerically
% We will integrate the square root function x^(1/2) over the interval
% "x ranges from 0 to 1."
%
% Samuli Siltanen November 2013
% Construct evaluation points for quadrature
n = 10000;
x = [1:n]/n;
dx = x(2)-x(1);
% Evaluate the function to be integrated
%f = ones(size(x));
f = sqrt(x);
% Integrate
int = (1/n)*sum(f)