Ajay Kejriwal
Ajay Kejriwal

Reputation: 41

How to add a Sequence of Estimates to my Newton Raphson Code for matlab?

My code works BUT I need to add 2 more things:

Upvotes: 0

Views: 321

Answers (1)

Acorbe
Acorbe

Reputation: 8391

well, everything you need is pretty much done already and you should be able to deal with it, btw..

  1. max iteration is contained in the variable i, thus you need to return it; add this

     function [ R, E , i] = myNewton( f,df,x0,tol )
    
  2. Plot sequence of estimates:

    plot(R); %after you call myNewton
    
  3. display max number of iterations

    disp(i); %after you call myNewton
    

Upvotes: 1

Related Questions