No BSD License  

Highlights from
weighted least-squares + weighted min-max optimization

from weighted least-squares + weighted min-max optimization by Lai Chiong Ching
Optimization using both weighted least squares and weighted min-max

egCostFunc(x)
% Example of cost function for demonstration of FWLSMM
% Cost function, 
%   F(X) = |A*x - c|
% 
% with x in R^2

function y = egCostFunc(x)

A = [0.5, 4; -3, 1.6; 9.5, -7.6; 0.9, -1.1];
c = [0.4; 2; -1.3; 1];

y = abs(A*x - c);

Contact us at files@mathworks.com