[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fzero tolerance issue ... and a related bug
From: |
Martin Helm |
Subject: |
Re: fzero tolerance issue ... and a related bug |
Date: |
Thu, 18 Oct 2012 20:22:30 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 |
Am 18.10.2012 19:46, schrieb Joza:
> So related to all that above, how does one find the root of a function that
> is always positive, or zero, but never negative? For instance, an absolute
> value: f(x) = abs(x - 2)
>
> This has root 2, but I can't give it an initial bracket [x1,x2] since
> f(x2)*f(x2) >= 0.
> Indeed, how could fzero even find an initial bracket?
>
> So how can one solve such a simple equation with fzero?
>
You simply do not solve such an equation with fzero since it does not
belong to the class of equations fzero is made for, instead use fsolve
fsolve( @(x) abs(x-9.1)^4.5, 8, optimset("TolFun", 1e-20))
ans = 9.0999
- fzero tolerance issue ... and a related bug, Joza, 2012/10/17
- Re: fzero tolerance issue ... and a related bug, Jordi GutiƩrrez Hermoso, 2012/10/17
- Re: fzero tolerance issue ... and a related bug, Joza, 2012/10/17
- Re: fzero tolerance issue ... and a related bug, Jordi GutiƩrrez Hermoso, 2012/10/17
- Re: fzero tolerance issue ... and a related bug, Joza, 2012/10/18
- Re: fzero tolerance issue ... and a related bug, marco atzeri, 2012/10/18
- Re: fzero tolerance issue ... and a related bug, Joza, 2012/10/18
- Re: fzero tolerance issue ... and a related bug, Joza, 2012/10/18
- Re: fzero tolerance issue ... and a related bug, James Sherman Jr., 2012/10/18
- Re: fzero tolerance issue ... and a related bug, marco atzeri, 2012/10/18
- Re: fzero tolerance issue ... and a related bug,
Martin Helm <=