MATLAB code for various optimization methods.