MATLAB optimization algorithm case analysis and application code