|
"Alax Baya" <calashbidon@hotmail.fr> wrote in message <h2c251$rr0$1@fred.mathworks.com>...
> Hello,
>
> I'm trying to use fzero to solve to get the root of some equation, and as you know it requires to specify an interval (2 endpoints) where the solution lies. However I'm having trouble determining those endpoints (only know it's in [0,1]). Is there another command I can use in Matlab that doesn't require to specify exactly the interval? If not, another software?
>
> Thanks
Hi,
It is quite normal that a function for solving a problem of zero of general function should have some starting point, where to look for a closest zero. I am affraid that there is no function that does not need a starting point.
As far as the interval, say [a,b], of possible solution is concerned, it may accelerate a solution, if (fun(a)*fun(b))<0, otherwise an error is generated.
If you do not know better estimate, start with fzero('fun', 0.5) or with fzero('fun',[0;1]), provided the above condition is fulfilled. The function fzero is very efficient, so you will get a solution rather quickly.
Mira
|