x = lsqnonneg(C, d)
[x, resnorm, residual, exitflag, output, lambda] = lsqnonneg(C, d, options)
| Parameter | Description |
|---|---|
| C | coefficient matrix. |
| d | right-hand side vector. |
| options | solver options. |
| Parameter | Description |
|---|---|
| x | nonnegative least-squares solution. |
| resnorm | squared residual norm. |
| residual | d - C*x. |
| lambda | KKT multipliers for nonnegativity constraints. |
lsqnonneg solves min norm(C*x-d)^2 subject to x >= 0 using an active-set method.
C = [1 0; 0 1; 1 1];
d = [1; 2; 3];
[x, resnorm] = lsqnonneg(C, d)
| Version | Description |
|---|---|
| 2.0.0 | initial version |