开发者

Check if caller == base workspace in MATLAB

Is there a pretty way to check if the caller workspace is actually the base workspace?

I guess I could easily use the assignin or evalin functions to assign something in base workspace and then check if that variable has changed or been assigned in caller workspace, but this seems to be kind of a ha开发者_Go百科ck.


Use DBSTACK

%# true if the function has been called from base
callerIsBaseWorkspace = length(dbstack) == 1; 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜