Argmin of a sum function - optimization of min search
<p>I'm trying to write the following optimization problem in Matlab:</p>
<blockquote>
<p>g = argmin Σ<sub>k=1,2,3</sub> ( (v<sub>k</sub> - c<sub>1</sub>) - g·(D<sub>k</sub> - c<sub>2</sub>) )²</p>
<p>c<sub>1</sub> and c<sub>2</sub> are constants. v<sub>k</sub> and D<sub>k</sub> are vectors. g has to be positive.</p>
</blockquote>
<p>I have realized that MATLAB has a built in function <a href="http://nl.mathworks.com/help/matlab/ref/fminsearch.html" rel="nofollow noreferrer">fminsearch</a> which should be able to perform the task, however I don't know how to include the sum over all <code>k</code> in the function.</p>