MathWorks interview question

Coding using Matlab