Basic MATLAB Functions for Linear and Non-Linear Optimization
3.1 Solutions of Equations and Systems of Equations
MATLAB allows you to solve equations and systems of equations using the commands below:
Solves the equation in the variable x.
syms x; solve(equ(x), x)
Solves the equation equ (x) in the variable x.
solve(‘eq1,eq2,…,eqn’, ‘x1, x2,…,xn’)
Solves n simultaneous equations eq1,…, eqn (in the variables x1,…, xn).
X = linsolve (A, B)
Solves A * X = B for a square matrix A, where B and X are matrices.
x = nnls (A, b)
Solves A * x = b in the sense of least squares, where x is a vector (x ≥ 0).
x = lscov(A,b,V)
Solves A ...