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
Does the root directory have any subdirectories you cannot search as an ordinary user? Does the root directory have any subdirectories you cannot read as a regular user? Exp
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
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 function called small_elements that takes as input an array named X that is a matrix or a vector. The function identifies those elements of X that are smaller than t
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
Show that subtracting the Laplacian from an image is proportional to unsharp masking. Use the definition for the Laplacian in the discrete case to derive the equivalence rel
Value for the side of the octagonal prism, and a scalar value for the height of the octagonal prism. Generate the x,y,z arrays that define the 9 faces of the pyramid (octago
Create a function TotalDaysMonth(intYear, intMonth, strIndOrCum) in both VB and Matlab to calculate the cumulative days or number of days in a given month, depending on inpu