You are on page 1of 1

CSE 403 PROGRAMMING ASSIGNMENT 1

Deadline: {CSE Nov 27, 2012, IT Nov 28, 2012, EEE/ECE Nov 29, 2012} @ Midnight Assignment Type: Individual Weight: 10 Write a MATLAB function for the bisection method. Bisection method %Solve f(x) = 0 by using the bisection method. function [x, err, xx] = bisection(f, a, b, TolX, MaxIter) %input % f = ftn to be given using inline() % a/b = initial left/right point of the solution interval % TolX = upperbound of error |x(k) - xo| % MaxIter = maximum # of iterations %output % x = point which the algorithm has reached % err = (b - a)/2(half the last interval width) % xx = history of x endfuntion Display an error message if f af b0

You might also like