moreRoot2

moreRoot2 - function Xs = NewtonRoot2(Fun,Xest,imax) syms x...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
%%This function finds a numerical solution to the function (Fun). %Fun = Function of 2 variables %FunDer = symbolic derivative of Fun %Xest = trial solution for root to Fun %imax = number of iterations %Xs = output of NewtonRoot - stores all values of x
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: function Xs = NewtonRoot2(Fun,Xest,imax) syms x Xi(1)=Xest; %Xi is couter variable that stores values of x FunDer = diff('Fun'); for i=2:imax Xi(i) = Xest - subs(Fun,Xest)/subs(FunDer,Xest); Xest = Xi(i); end Xs = Xi;...
View Full Document

Ask a homework question - tutors are online