diff options
Diffstat (limited to 'macros/lsqnonneg.sci')
-rw-r--r-- | macros/lsqnonneg.sci | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/macros/lsqnonneg.sci b/macros/lsqnonneg.sci index 3b152bf..3e5ea81 100644 --- a/macros/lsqnonneg.sci +++ b/macros/lsqnonneg.sci @@ -97,6 +97,12 @@ function [xopt,resnorm,residual,exitflag,output,lambda] = lsqnonneg (varargin) C = varargin(1); d = varargin(2); nbVar = size(C,2); + + if(nbVar == 0) then + errmsg = msprintf(gettext("%s: Cannot determine the number of variables because input objective coefficients is empty"), "lsqnonneg"); + error(errmsg); + end + if ( rhs<3 | size(varargin(3)) ==0 ) then param = list(); else |