MathWorks interview question

Walk me through ur thought process for this problem