% % Calculate the first difference between % points in a series % dif=firstdif(series) % Written by Marinna Martini function dif=firstdif(series); m=100; N=length(series); for i=1:(N-1), dif(i)=abs(series(i)-series(i+1)); if dif(i) ~= 0, if dif(i) < m, m = dif(i); end end end fprintf('Minimum is %f',m)