The following solvers handle linear or quadratic objective functions:
linprog and intlinprog:
minimize
f'x = f(1)*x(1) + f(2)*x(2)
+...+ f(n)*x(n).
Input the vector f for the objective. See
the examples in Linear Programming and Mixed-Integer Linear Programming.
lsqlin and lsqnonneg:
minimize
∥Cx - d∥.
Input the matrix C and the vector d for
the objective. See Linear Least Squares with Bound Constraints.
quadprog: minimize
1/2 * x'Hx + f'x
= 1/2 * (x(1)*H(1,1)*x(1) + 2*x(1)*H(1,2)*x(2)
+....
+ x(n)*H(n,n)*x(n)) + f(1)*x(1) + f(2)*x(2) +...+
f(n)*x(n)
Input both the vector f and the symmetric
matrix H for the objective. See Quadratic Programming.