12.07.2015 Views

What Is Optimization Toolbox?

What Is Optimization Toolbox?

What Is Optimization Toolbox?

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

fseminffunThefunctiontobeminimized. fun is a function that accepts a vector x andreturns a scalar f, the objective function evaluated at x. The function fun canbe specified as a function handle for an M-file functionx = fseminf(@myfun,x0,ntheta,seminfcon)where myfun is a MATLAB function such asfunction f = myfun(x)f = ...% Compute function value at xfun can also be a function handle for an anonymous function.fun = @(x)sin(x''*x);If the gradient of fun canalsobecomputedand the GradObj option is 'on',as set byoptions = optimset('GradObj','on')then the function fun must return, in the second output argument, the gradientvalue g, avector,atx. Note that by checking the value of nargout the functioncan avoid computing g when fun is called with only one output argument (inthe case where the optimization algorithm only needs the value of f but not g).function [f,g] = myfun(x)f = ...if nargout > 1g = ...end% Compute the function value at x% fun called with 2 output arguments% Compute the gradient evaluated at xnthetaThe gradient is the partial derivatives of f at the point x. Thatis,the ithcomponent of g is the partial derivative of f with respect to the ith componentof x.The number of semi-infinite constraints.8-94

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!