From: Loren Shure on
In article <hrc8pj$ti$1(a)fred.mathworks.com>,
matlab(a)robertREMOVEcampbell.removethis.co.uk says...
> Steven, for the record what I was doing was
>
> function varargout=X(varargin)
> if nargout>2
> disp("you're using function X with the old output format")
> end
>
> Being able to report who called function X is just a nicety so that people know where to look when updating code. dbstack does what I needed.
>

If you want this for the main function in the file, you can use
mfilename.

--
Loren
http://blogs.mathworks.com/loren
http://matlabwiki.mathworks.com/MATLAB_FAQ