Answered step by step
Verified Expert Solution
Question
1 Approved Answer
%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, 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 functionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started