C Math Library Reference | ![]() ![]() |
Minimize a function of several variables
Minimum number of arguments: six, maximum: user-defined. Terminate argument list with a NULL
.
C Prototype
mxArray *mlfFminsearch(mxArray **fval, mxArray **exitflag, mxArray **output, mxArray *funfcn, mxArray *x0, mxArray *options, ...);
C Syntax
#include "matlab.h" mxArray *x0; /* Required input argument(s) */ mxArray *options, *P1, *P2; /* Optional input argument(s) */ mxArray *fval = NULL; /* Optional output argument(s) */ mxArray *exitflag = NULL; /* Optional output argument(s) */ mxArray *output = NULL; /* Optional output argument(s) */ mxArray *x = NULL; /* Return value */ /* MATLAB syntax: x = fminsearch(fun,x0) */ mlfAssign(&x, mlfFminsearch(NULL,NULL,NULL,mxCreateString("
func
"),
x0,NULL,NULL));
/* MATLAB syntax: x = fminsearch(fun,x0,options) */ mlfAssign(&x, mlfFminsearch(NULL,NULL,NULL,mxCreateString("
func
")
, x0,options,NULL)); /* MATLAB syntax: x = fminsearch(fun,x0,options,P1,P2,...) */ mlfAssign(&x, mlfFminbnd(NULL,NULL,NULL,mxCreateString("
func
")
, x0,options,P1,P2,...,NULL)); /* MATLAB syntax: [x,fval] = fminsearch(...) */ mlfAssign(&x, mlfFminsearch(&fval,NULL,NULL,mxCreateString("
func
")
, x0,NULL,NULL)); mlfAssign(&x, mlfFminsearch(&fval,NULL,NULL,mxCreateString("
func
")
, x0,options,NULL)); mlfAssign(&x, mlfFminsearch(&fval,NULL,NULL,mxCreateString("
func
")
, x0,options,P1,P2,...,NULL)); /* MATLAB syntax: [x,fval,exitflag] = fminsearch(...)*/ mlfAssign(&x, mlfFminsearch(&fval,&exitflag,NULL,mxCreateString("
func
")
, x0,NULL,NULL)); mlfAssign(&x, mlfFminsearch(&fval,&exitflag,NULL,mxCreateString("
func
")
, x0,options,NULL)); mlfAssign(&x, mlfFminsearch(&fval,&exitflag,NULL,mxCreateString("
func
")
, x0,options,P1,P2,...,NULL)); /* MATLAB syntax: [x,fval,exitflag,output] = fminsearch(...) */ mlfAssign(&x, mlfFminsearch(&fval,&exitflag,&output,mxCreateString("
func
"), x0,NULL,NULL)); mlfAssign(&x, mlfFminsearch(&fval,&exitflag,&output,mxCreateString("
func
"), x0,options,NULL)); mlfAssign(&x, mlfFminsearch(&fval,&exitflag,&output,mxCreateString("
func
"), x0,options,P1,P2,...,NULL));
Syntax
x = fminsearch(fun,x0) x = fminsearch(fun,x0,options) x = fminsearch(fun,x0,options,P1,P2,...) [x,fval] = fminsearch(...) [x,fval,exitflag] = fminsearch(...) [x,fval,exitflag,output] = fminsearch(...)
.See Also
fminsearch
Calling Conventions![]() | mlfFmins | mlfFopen | ![]() |