Thread Subject: Using fzero

Subject: Using fzero

From: Alax Baya

Date: 30 Jun, 2009 03:52:01

Message: 1 of 3

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

Subject: Using fzero

From: Miroslav Balda

Date: 30 Jun, 2009 05:01:01

Message: 2 of 3

"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

Subject: Using fzero

From: Steven Lord

Date: 30 Jun, 2009 13:55:31

Message: 3 of 3


"Alax Baya" <calashbidon@hotmail.fr> wrote in message
news: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.

... OR a starting point, as Miroslav said. The interval option is
preferred, but the single starting point is accepted as well.

--
Steve Lord
slord@mathworks.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
fzero Sprinceana 1 Jul, 2009 11:17:21
rssFeed for this Thread

Contact us at files@mathworks.com