%
%  Here is a comment section
%
% approximate derivative calculations for f(x)=sin(x)
%
function y=Df(x,n)
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;
end
%
%
%   SOME EXPLANATORY NOTES:
%
%   out(i,:) is the i-th row of the matrix out(i,j)
%   [i;h;y;error] is a row vector
%   out(i,:)=blah assigns the row vector blah to the i-th row.
%