Function Reference
— Function File: x = lsqnonneg (c, d)
— Function File: x = lsqnonneg (c, d, x0)
— Function File: [x, resnorm] = lsqnonneg (...)
— Function File: [x, resnorm, residual] = lsqnonneg (...)
— Function File: [x, resnorm, residual, exitflag] = lsqnonneg (...)
— Function File: [x, resnorm, residual, exitflag, output] = lsqnonneg (...)
— Function File: [x, resnorm, residual, exitflag, output, lambda] = lsqnonneg (...)

Minimize norm (c*x-d) subject to x >= 0. c and d must be real. x0 is an optional initial guess for x.

Outputs:

  • resnorm

    The squared 2-norm of the residual: norm(c*x-d)^2

  • residual

    The residual: d-c*x

  • exitflag

    An indicator of convergence. 0 indicates that the iteration count was exceeded, and therefore convergence was not reached; >0 indicates that the algorithm converged. (The algorithm is stable and will converge given enough iterations.)

  • output

    A structure with two fields:

    • "algorithm": The algorithm used ("nnls")
    • "iterations": The number of iterations taken.
  • lambda

    Not implemented.

See also: optimset