MATLAB: Lsqlin Failure! Why is the simple example provided by MATLAB failing to execute

lsqlinoptimization

I recently discovered the MATLAB optimization routine lsqlin. I attempted to run a simple 'MATLAB-approved' example to get a feel for the function: http://www.mathworks.com/help/toolbox/optim/ug/lsqlin.html. The example is written slightly beyond the middle of the page. I executed a simple copy/paste of the code, but received the following error message:
>> [x,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[ ],[ ],lb,ub);
Warning: Large-scale algorithm can handle bound constraints only; using medium-scale algorithm instead.
> In lsqlin at 286
Optimization terminated.
I tried executing the function again, but this time without referencing the final four parameters:
>> x = lsqlin(C,d,A,b);
Warning: Large-scale algorithm can handle bound constraints only; using medium-scale algorithm instead. > In lsqlin at 286 Optimization terminated.
I am running MATLAB 2009b and have verified that the Optimization Toolbox is installed. Any help is appreciated.

Best Answer

I tried the example and it gave the warning but the outputs x, etc., were the same as in the example. "Optimization terminated" sounds ominous, but it just means that it finished successfully.
If you want to run this same example without the warning, try this:
>> options = optimset('lsqlin');
>> options = optimset(options,'LargeScale','off');
>> [x,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,[ ],[ ],lb,ub,[],options);