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
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