Leetcode Find The Maximum Of A Function Matlab