%% Nonnegative Least Squares with Nondefault Options
% Set the Display option to 'final' to see output when lsqnonneg finishes.
% Create the options.

options = optimset('Display','final');

%
% Prepare a C matrix and d vector for the problem \min||Cx-d||.

C = [0.0372    0.2869
     0.6861    0.7071
     0.6233    0.6245
     0.6344    0.6170];

d = [0.8587
     0.1781
     0.0747
     0.8405];

%
% Call lsqnonneg with the options structure.

x = lsqnonneg(C,d,options);

% Copyright 2012 The MathWorks, Inc.