MATLAB: How to get name of a function (within the function)

MATLABprogramming

Wise gentlemen: how do I get the name of a function within the function?

Best Answer

Inside the function call the following:
st = dbstack;
namestr = st.name