f = @(x) (x^2 - 25);
fdash=@(fun,x,epsilon)imag(fun(x(:)+1i*epsilon))/epsilon;
g=@(x)fdash(f,x,10^-20);

disp(g(9))