function [y]=sample(a,b,n)
y = (a : (b-a)/n : b);
% or linspace(a,b,n+1)
function [y]=d(x)
y = diff(x);
function [y] = mids(x)
n=length(x);
y=(x(1:n-1) + x(2:n)) / 2;
function [y]=S(x)
y = cumsum([0 , x]);
sum is a primitive function |
A typical sequence to demonstrate that the derivative
of the integral returns the original function might consist of
x = sample(0, 3, 100) ;
y = exp(- x .^
2) ;
Iy = S (mids(y) .* d(x)) ;
DIy = d(Iy) ./ d(x) ;
plot (x,y,mids(x),DIy)
|