Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从 simulink Level 1 S-function 调用 clear all。我看了一下, doc mexCallMATLAB但我不知道如何使用它。我想在调用我的函数后清除工作空间。
doc mexCallMATLAB
你确定你在写一个一级 S-Function 吗?如果你是,那么你不应该。现在,m-code 和 c-code S-Function 都应该写成 level-2。
您没有具体说明您是用 m-code 还是 c-code 编写,但既然您已经提到mexCallMATLAB它假定您正在使用 c-code,在这种情况下您应该使用
mexCallMATLAB
mexEvalString("clear('all');");
如果您使用的是 m 代码,那么只需使用
evalin('base','clear all');