MathWorks Interview Question

Walk me through ur thought process for this problem