Matlab Defining Function Inside A Function