"Matt beach" <firstname.lastname@example.org> wrote in message news:email@example.com... > Hi, > Is there a way to have fzero avoid certain roots? > i.e. my polynomial always has 0 as a root, but I don't want it to find > zero everytime! > I know Maple has the avoid=[t=0] command, not sure if matlab has a similar > one?
"If x0 is a vector of length two, fzero assumes x0 is an interval where the sign of fun(x0(1)) differs from the sign of fun(x0(2)). An error occurs if this is not true. Calling fzero with such an interval guarantees fzero will return a value near a point where fun changes sign."
So specify an interval that doesn't include 0 where the sign of your function is different at each endpoint.