Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone explain this matlab code for Newton's method? specificaly the lines that i marked with %%%% Then, use your function to estimate 7 by

can someone explain this matlab code for Newton's method? specificaly the lines that i marked with %%%%

Then, use your function to estimate 7 by finding the positive root of f(x) = x2 7. Try two different initial guesses: (i) x0 = 2 and (ii) x0 = 500 and consider |xk+1 xk| < 10^10 as a convergence criterion.

>> clear all close all clc f=@(x) x^2-7; df=@(x) 2*x; n=10;%%%%% x=zeros(1,n);%%%%% x(1)=2; for i=1:n fun=f(x(i)); derfun=df(x(i)); frac=f(x(i))/df(x(i)); x(i+1)=x(i)-(f(x(i))/df(x(i))); error=abs(x(i+1)-x(i)) end x'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions

Question

=+multiplicity 1). If A + 1, then |A| Answered: 1 week ago

Answered: 1 week ago

Question

Does it have at least one-inch margins?

Answered: 1 week ago

Question

Does it highlight your accomplishments rather than your duties?

Answered: 1 week ago