Write a matlab function newtonraphson
Course:- MATLAB Programming
Reference No.:- EM13166978

Assignment Help
Assignment Help >> MATLAB Programming

Write a MATLAB function newtonRaphson(fx, x0, sigfig, maxIT) that will return a root of the function f(x) near x=x0 using the Newton-Raphson method, where sigfig is the accuracy of the solution in terms of significant figures, and maxIT is the maximum number of iterations allowed. In addition to the root (xr), the function newtonRaphson is expected to return the number of iterations and an error code (errorCode). As such, the first line of the function m file newtonRaphson.m must read as:
function [xr, nIT, errorCode] = newtonRaphson(fx, x0, sigfig, maxIT)
Include comments and necessary checks against divergence, and divide by zero situations.
Use a subfunction to calculate the derivatives.

Put your comment

Ask Question & Get Answers from Experts
Browse some more (MATLAB Programming) Materials
Construct a full-spectrum least-squares fit to the tissue spectrum. Using these fitting coeffcients for oxy and deoxy hemoglobin, calculate the O2 saturation percentage.
Create a function called "hollowSphere" that calculates the volume using the formula shown in Problem I. Then write a script that prompts the user for the value of the inner
The program runs, then stops and gives an error of double going into the switch. I changed the code to make it output the sounds, but my whole reasoning was to make this ver
Step One: For the design specifications of your filter, see the excel file for specifications (UDO). You need to demonstrate for the first two iterations( n=0 & n=1), by
Perform linear regression on penicillin clearance using the normal equations - plot the concentration data and re-plot the log of the concentration data to show that it appear
Write a mileage per Gallons and miles per dollar calculator program using two functions, one to calculate MPG and one to calculate MPD. The application will prompt the user
Find the solution of the differential equation - Find the Laplace transform - Find the Laplace transforms of the functions - Using Matlab and Laplace transform, find the solut
plot the total gravity effect of the 5 cylinders by summing their effects at each observation point on the profile.   What is the mean value and standard deviation of the tota