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

1 次查看(过去 30 天)
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!!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by