I have created two functions "myfun1" and "myfun2". The "myfun1" function calls the "myfun2" function. In "myfun2", I have the following code:
function myfun2mfilenameevalin('caller', 'mfilename')
and here is myfun1 function:
function myfun1myfun2
When I execute the function by typing in the following command:
myfun1
I receive the following output:
ans = myfun2 ans = myfun2
I expect the output to be:
ans = myfun2 ans = myfun1
Best Answer