tries to find a zero of an function defined by fun near x0 if x0 is a scalar

# Tries to find a zero of an function defined by fun

This preview shows page 20 - 21 out of 21 pages.

tries to find a zero of an function defined by fun near x0, if x0 is a scalar. The value x returned by fzero fzero is near a point where fun changes sign, or NaN if the search fails. In this case, the search terminates when the search interval is expanded until an Inf, NaN, or complex value is found. >> x = fzero(‘x^3-5*x^2-x+2’,2) function f = fun (x) f = x^3 - 5*x^2 – x + 2; MATLAB Function: fzero fzero
June 25, 2020 ME262 Numerical Analysis Sessional 21 The roots roots function allows you to calculate the roots of a polynomial function. MATLAB Command: First, we represent the polynomial function by a row vector containing the coefficients. For the given example, this can be done as follows: >> f = [1 -5 -1 2] Next, we can type the following command to obtain the roots of the equation >> x = roots ( f ) MATLAB Function: roots roots

#### You've reached the end of your free preview.

Want to read all 21 pages?

• Summer '19
• Root-finding algorithm, Numerical Analysis Sessional,  f

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern