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
Identification of the professional accounting, management and/or public relations issues in your workplace - How do you applied knowledge from this degree study in solving you
Design and synthesis of continuous time controllers - A graphical user interface (GUI) is a human-computer interface that uses menus, dialogue box, and button which can be ma
Write a user defined function FindFrequency which inputs are a time and a wave elevation vector and output the approximated wave frequency (fappr=FindFrequency(t,eta)).
Consider a CSTR with a feed stream containing only A at a concentration of cA and the reactions A?B?C taking place in the CSTR. Both reactions are first order in the reactan
Write a MATLAB code to simulate rigid body mechanics. Create a video file of a free falling rod. Neglect effects from drag or loss of kinetic energy. Make sure the rod falls o
Kerfuffleboard is a game very much like Shuffleboard. Players take turns shooting disks at a trianglular scoring area. While the scoring areas are the same in shuffleboard a
Given that the le data.txt contains only real numbers seperated by white space, write down a sequence of maple commands that will read the data into a maple list and then p
Consider a point-to-point radio link between two highly directional antennas in a stationary environment. The antennas have antenna gains of 30 dB, distance attenuation is 1