distsummin function

Returns the solution of the minimization problem