MathWorks interview question

Difference between Sub function and nested function