Question: %Newton Raphson Method %Finds the roots of the function. %Inputs: f, function % f1, first derivative of f % xold, initial guess % tol, tolerance

 %Newton Raphson Method %Finds the roots of the function. %Inputs: f,

%Newton Raphson Method %Finds the roots of the function. %Inputs: f, function % f1, first derivative of f % xold, initial guess % tol, tolerance of accuracy of solution %Outputs: r = root % i = number of iterations function [r, i] = NewtonRaphsonMethod(f,f1,xold,tol)

format long format compact

%Initialize res (value of f at approximation) res = 100;

%Set iteration counter i=1;

%Newton Raphson Method %Runs while res is greater than the tolerance OR until 1000 iterations have %been completed while res > tol & i

r = xnew;

Generate a MATLAB script to obtain all roots of the following polynomial lying in the range -5.5 to 4.0 by the Newton-Raphson Method using NewtonRahphson.m. f(x) = 1.1x + 1.15x2 - 17.1x+15.2 Using MATLAB, draw a graph of the polynomial for the given range of x. Label it and give it a title. Verify your answers by using the fzero function. Also obtain all the roots of the polynomial with the roots function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!