这是执行此操作的功能(不打印任何消息):
function stoprun()
ms.message='';
ms.stack = dbstack('-completenames');
ms.stack(1:end) = [];
ds = dbstatus();
stoponerror = any(strcmp('error', {ds.cond}));
setappdata(0, 'dberrorkeep', stoponerror);
dbclear error
error(ms);
end