MathWorks Interview Question

Had 2 coding questions, some math questions, some MATLAB questions