Question: Write one matlab script that computes the root for f(x)=e^x+x^3+2x^2-1.2 for x0=0.4 (' x1= 0 for secant and false-positioning) using all three methods (newtonraphson, secant
Write one matlab script that computes the root for f(x)=e^x+x^3+2x^2-1.2 for x0=0.4 (' x1= 0 for secant and false-positioning) using all three methods (newtonraphson, secant and false-positioning). You need to store the roots of the three different methods in three different arrays: rootNR, rootSCT, rootFP. The array will hold the results of the solutions at each iteration and is indexed by the iteration number. The iterations should continue until the worst solution among the three solutions reaches 5 significant digits.
newton raphson formula=> xn+1=xn F(xn)/F'(xn).
secant formula: xn+1=xn- f(xn)(xn-xn-1)/f(xn)-f(xn-1)
false positiong formula: xn+1=xn-F(xn)(xn-xo)/F(xn)-F(xo)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
