well, everything you need is pretty much done already and you should be able to deal with it, btw..
max iteration is contained in the variable
i
, thus you need to return it; add thisfunction [ R, E , i] = myNewton( f,df,x0,tol )
Plot sequence of estimates:
plot(R); %after you call myNewton
display max number of iterations
disp(i); %after you call myNewton