how to solve optimization problem in matlab