Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB Write a code bisect.m that implements the bisection method for finding a root of F(x) = 0 in an interval [a , b] to

MATLAB

Write a code bisect.m that implements the bisection method for finding a root of F(x) = 0 in an interval [a , b] to a given accuracy. ? The code should accept inputs: a , b, TOL , should print out the iterates: n x F(x) ERRn (neatly, in columns, use format: %d %f %e %e ), ? and upon convergence it should print out the value of the root, the residual, the error and how many iterations it took. ? The (formula for the) function F(x) should be coded in a function subprogram: function y = FCN(x) ? You may set maxIT=100; in the code. ? Of course, you must debug the code (on a simple problem with known solution).

Now use your bisection code on the cubic (image text in transcribed), with the following inputs: ? ? a. a, b, TOL: 1 , 2 , 1.e-6 ? ? b. a, b, TOL: 1 , 2 , 1.e-15 ? ? c. a, b, TOL: -4 , 4 , 1.e-6 and 1.e-15

F(x) = x3 + x2-3x-3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions