Numerical Analysis in MATLAB
Posted on Dec 04, 2012 in Computer Science
Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.
-
fmincon
finds minimum of constrained nonlinear multivariate function.fminunc
finds minimum of unconstrained nonlinear multivariate function.fgoalattain
solves multiobjective goal attainment problems;fminimax
solves minimax constraint problems. -
When you use one of these functions mentioned above to do optimizations, you might want to pass extra parameters to the objective function. You can do this directly in R, however, you have to this indirectly in MATLAB. To pass extra parameters to the objective function, there are 3 different ways: anonymous function, nested function and global variable. I think anonymous function is the best an most nature way to do it. Suppose you have defined an objective function
myObjFun(x,a,b,c)
, and you want to do optimization for givena
,b
andc
. You can first specify values fora
,b
andc
, define a function handlef=@(x)myObjFun(x,a,b,c)
, and then optimize function handlef
. -
quadl
can be used to numerically calculate integrals. To calculate integrals symbolically, you can useint
.