MATLAB: Matrix is singular, RCOND=NAN

matrixoptimization

I am using the following code in a simulation and get a warning message. Is there any way to correct it?
lb = 0.00001*ones(2,1);
ub = 0.99998*ones(2,1);
options =optimset('Display','off','LargeScale','off');
coef = lsqlin(bC,by,[],[],[],[], lb ,ub ,[],options);
Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN. > In qpsub at 359 In lsqlin at 336 In seasonalarch1 at 330
Thanks

Best Answer

You are constructing C and y inadequately. You do not have enough linear equations, or they are not linearly independent enough, to uniquely identify the actual coef. Find additional and more informative equations and add them as new rows to C and y until cond(C) improves.
Related Question