|
"Matt Fig" <spamanon@yahoo.com> wrote in message <hec9of$ok0$1@fred.mathworks.com>...
> See the help for:
>
> mfilename
To add a little detail (in case you're as obtuse as I am):
function = funF()
myCall(mfilename)
end
function myCall(caller)
caller
end
This works only if funF is in a file named funF.m.
You might have better luck with dbstack, which returns the call chain. I think you can get what you want with dbstack(1) and then you must figure out how to parse the output. The output is delivered in an nx1 struct which I have no idea how to parse (seeing as how I'm a newbie to Matlab), and the first element of that structure seems to contain what you want.
Good luck,
-Jeff
|