how to solve optimization problem with matlab