clc,clearf = @(x)((15*x)./(4*x.^2-3*x+4));x = fminbnd(f, 0, 10);xy=f(x);y
this code returns
x = 9.9999y = 0.4011
while the real minimum is at x=0 and y=0, because of this explanation "The algorithm is based on golden section search and parabolic interpolation. Unless the left endpoint x1 is very close to the right endpoint x2, fminbnd never evaluates fun at the endpoints, so fun need only be defined for x in the interval x1 < x < x2. If the minimum actually occurs at x1 or x2, fminbnd returns an interior point at a distance of no more than 2*TolX from x1 or x2, where TolX is the termination tolerance."
how can i find the real minimum even in endpoints? please help me.
Best Answer