- dbstack(), @Junuxx:
if isempty(dbstack)
%# true if you evaluated the cell while not in debug mode
, , /, dbstack
function doSomething
if length(dbstack)==1
%
%
, , :
function doSomething
if length(dbstack)==1
javaHistory=com.mathworks.mlservices.MLCommandHistoryServices.getSessionHistory;
lastCommand = javaHistory(end).toCharArray'; % ' added for SO code highlighting
if strfind(lastCommand,'doSomething')
%
else
%
, , - line -argument dbstack , , .