% Sample MATLAB session with Newton's method. % Download Kartik's MATLAB codes % newton.m and myfunc.m into your directory % from where your run MATLAB. % Last modified by Kartik % January 29th, 2008. clear all; [x,xiter,ithist,iflag] = newton(@myfunc,[0 3]',1e-6,100); 'the solution x is' x 'the iteration history is' ithist 'iflag is' iflag 'x value in the 7th iteration is' xiter{7}