Search
 
SCRIPT & CODE EXAMPLE
 

MATLAB

matlab root finding function

% Function for the bisection method.
% Finds root for given function f, left and right boundaries a and b and tolerance TOL
% f(a).*f(b)<0 is a requirement for this function to work

function c = bisection(f, a, b, TOL)
  while(b−a)/2>TOL
    c = (a+b)./2;
    if f(c)=0
      return
    end %if
  
    if f(a)f(c)<0
      b=c;
    else
      a=c;
    end %If
  end %While  
end %Function
Comment

PREVIOUS NEXT
Code Example
Matlab :: matlab 
Matlab :: matlab plotting multiple lines on one graph 
Matlab :: how to get the highest power of polynomial matlab 
Matlab :: matlab make last value the first one etc 
Matlab :: matlab select element of matrix 
Matlab :: matlab exclamation mark 
Matlab :: SAVE TABLE IN MATLAB 
Basic :: cmd cd not working 
Basic :: hello world in basic 
Basic :: NÃO CONSIGO MANDAR UM POST EM VBNET USANDO POSTMAN 
Basic :: vb.net printing set page size 
Elixir :: elixir try catch 
Elixir :: elixir timex format 
Elixir :: elixir strings 
Scala :: scala hello world 
Scala :: val in scala 
Scala :: scala multiline string 
Actionscript :: mass transit logging to seq 
Excel :: excel auto adjust row heights 
Perl :: perl post condition 
Perl :: len perl 
Pascal :: while do in pascal 
Powershell :: How to test HDD health in PowerShell 
Clojure :: clojure 
Assembly :: restart kde 
Assembly :: where correlation is used 
Assembly :: list all sensors android 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: jquery add input placeholder 
Javascript :: p5.js cdn 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =