Root Finding Using fzero Want to find the roots of a function (points where the function value is 0). Going to use function handles and anonymous functions to do this, please watch those first. Built in function in MATLAB - fzero(fun,x0) fun is a function handle to the function you want to find the roots of Can use an anonymous function to make this easy x0 is an initial guess (the closer you are, the faster it will get the result) x0 can be a vector of 2 points, but the function must have different signs at the end points Usually should try plotting the function to estimate a reasonable x0 Example: find roots of x^3 - 3x^2+x/2+2cos(x) plot from -1 to 3.5 root1 = fzero(@fctn, -0.7); toBeZero = @fctn; root2 = fzero(toBeZero, [0.5, 1.5]); root3 = fzero(@(a)fctn(a), 3); root3 = fzero(@(y)y^3 - 3*y^2 + y/2 + 2*cos(y),m3); Can also use this to find where a function is equal to a specific value. Ex: find where f(x) = 4 (call fzero(@(x)fctn(x)-4, -0.5)) Note: need to create an anonymous function since we need to pass a function to fzero, not a calculated value