How to create a MATLAB function based offf of a flow chart? using for example f1(x) when referencing a function

1 view (last 30 days)
I am trying to convert this flow chart into a MATLAB function with the commands:
Set: xL=a, xU=b, xm= (a+b)/2
If f(xL)*f(xm) < 0 set xU= xm If f(xL)*f(xm) > 0 set xL= xm If f(xL)*f(xm) = 0 xm is the root. Stop the algorithm.
Guidelines: function result=bisect(a,b,tol) %INPUT : a, b:search interval % tol:error tolerance %OUTPUT: result : root found
Thanks for the help!!

Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!