MATLAB talk:Fzero

From PrattWiki
Jump to navigation Jump to search
  • It should be noted that fzero is incapable of calculating zeros that merely touch the x-axis instead of crossing it. Furthermore, fzero freaks out when it runs into an interval with an asymptote (Inf) or non a number (NaN). To quote: "The function values at the interval endpoints must differ in sign" and "Exiting fzero: aborting search for an interval containing a sign changebecause NaN or Inf function value encountered during search." —Preceding unsigned comment added by Faraz.yashar (talkcontribs)
    • True - DukeEgr93 08:58, 22 November 2010 (EST)
  • Is there any way to ignore errors and force a script to continue otherwise instead of trying to avoid specific errors from ever occurring with if statements? Consider the circumstance when looping through sets of intervals for fzero. Some intervals may yield an error. Can I just say, "Forget about it?": ignore the error and see what's up with the next set of values.—Preceding unsigned comment added by Faraz.yashar (talkcontribs)
    • There is a structure known as try...catch you can use. Put the code you want to allow to have errors in the "try" part and then what you want to do if there is an error in the "catch" part. DukeEgr93 08:58, 22 November 2010 (EST)