x = fmin('function',x1,x2)x = fmin('function',x1,x2,options)x = fmin('function',x1,x2,options,p1,p2, ...)[x,options] = fmin(...)
x = fmin('function',x1,x2) returns a value of x which is a local minimizer of function(x) in the interval x1 < x < x2. function is a string containing the name of the objective function to be minimized.
x = fmin('function',x1,x2,options) uses a vector of control parameters.
options(1) is nonzero, intermediate steps in the solution are displayed. The default value of options(1) is 0.options(2) is the termination tolerance. The default value is 1.e-4.options(14) is the maximum number of steps. The default value is 500.options are referenced by fmin. Other functions in the Optimization Toolbox reference the other options.
x = fmin('function',x1,x2,options,p1,p2,...) provides up to 10 additional arguments which are passed to the objective function, function(x,p1,p2,...).
[x,options] = fmin(...) returns a count of the number of steps taken in options(10).
fmin('cos',3,4) computes pi to a few decimal places.
fmin('cos',3,4,[1,1.e-12]) displays the steps taken to compute pi to 12 decimal places.
To find the minimum of the function
on the interval (0,2), write an M-file called f.m.
Then invokefunction y = f(x)y = x.^3-2*x-5;
fmin with
The result isx = fmin('f',0,2)
The value of the function at the minimum isx =0.8165
y = f(x)y =-6.0887
fmins,fzerofoptionsin the Optimization Toolbox
(c) Copyright 1994 by The MathWorks, Inc.