MATLAB老版本用LASTERROR函数,返回最后一条错误信息(不推荐,新版本不再使用此函数);
MATLAB新版本用MException class获取报错信息。
对于MException class,可以使用try-catch-end代码模块输出报错信息并保存到txt文件:
try
main函数
catch ME
% open file
fiderror = fopen('logFile.txt','a+');
% write t
MATLAB老版本用LASTERROR函数,返回最后一条错误信息(不推荐,新版本不再使用此函数);
MATLAB新版本用MException class获取报错信息。
对于MException class,可以使用try-catch-end代码模块输出报错信息并保存到txt文件:
try
main函数
catch ME
% open file
fiderror = fopen('logFile.txt','a+');
% write t