x=nnls(a,b)
Inputs  
a 
Any real matrix. 
b 
A vector with the same number of rows as a . 
Outputs  
x 
A vector with the same number of elements as the number of columns in a , with all the elements being positive.

norm(a*xb,2)
subject to the constraint that all of its
elements be positive.
>>a=[4 5;2 3; 7 8]; >>b=[10 8 9]' >>x=nnls(a,b) >>x 0 1.4898