MATLAB: Least squares where C*x is always greater than d

least squares

Dear all,
I have a C (matrix 40*13) and d (40). When I use least squares I get x. But then when I do C*x the result can be sometimes less than d. Is there a way to make sure you always get C*x >= d ?.
If not, what other approach would you recomend please?
Thank you
Zdenek

Best Answer

x = lsqlin(C,d,-C,-d)
Best wishes
Torsten.