Julia - the above code may be overcomplicating Newton's Method. I think the code is trying to only allow for 50 iterations (due to the for loop) but then has an unneeded while loop (plus a couple of others for the "backtracking"). You may want to start with a simpler algorithm and then decide if the backtracking is needed. Also, while you calculate y on each iteration, you don't use it on subsequent ones (you probably want to be setting the result to x to instead so that it changes on each iteration).
I think the above could be simplified to
function [min] = GCNewtons(x0)
f = @(x) exp(2*sin(x)) - x;
g = @(x) (2*exp(2*sin(x))*cos(x)) - 1;
h = @(x) (-2*exp(2*sin(x)))*(sin(x)-2*cos(x)^2);
tol = 10^-6;
x = x0;
for k = 1:50
x = x - (g(x) / h(x));
min = 0;
I've left the tolerance checks and the assignment of min to you. I'm assuming that h is the correct derivative of g.