%
%  Df.m not as a function.
%
%  approximate derivative calculations for f(x)=sin(x)
%
%  must first declare "x" and "n" for this to execute!
%
h=1;
format long
for i=1:n 
    h=h/4;
    approx=(sin(x+h)-sin(x))/h;
    error=abs(cos(x)-approx);
    out(i,:)=[i;h;approx;error];
end
    y=out;
%
