how to solve optimization problems with matlab