0% found this document useful (0 votes)
37 views1 page

1PA1 Bisection Assignment

This programming assignment for a CSE/IT/EEE course requires students to: 1) Write a MATLAB function that implements the bisection method to find the solution to a function f(x)=0. 2) The function must take in parameters for the function f, initial left and right points a and b, tolerance for error, and maximum number of iterations. 3) It must return the solution point x, error between the last two intervals, and a history of the solution points. 4) It must display an error if f(a)*f(b) is not less than 0.

Uploaded by

haftamu_hailu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

1PA1 Bisection Assignment

This programming assignment for a CSE/IT/EEE course requires students to: 1) Write a MATLAB function that implements the bisection method to find the solution to a function f(x)=0. 2) The function must take in parameters for the function f, initial left and right points a and b, tolerance for error, and maximum number of iterations. 3) It must return the solution point x, error between the last two intervals, and a history of the solution points. 4) It must display an error if f(a)*f(b) is not less than 0.

Uploaded by

haftamu_hailu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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