calling_func = dbstack;
if calling_func
is non-empty, it is being called by some other function (as opposed to being called directly by the user from the command prompt)
calling_func = dbstack;
if ~isempty(calling_func)
calling_func_names = {calling_func.name};
end
The names are stored in reverse order of heirarchy.
calling_func = dbstack;
if ~isempty(calling_func)
if find(strcmp('MyCoolFunc',{calling_func.name}))
% your cool function is calling this function
end
end