MATLAB 插桩输出
文章目录
- [MATLAB 插桩输出](#MATLAB 插桩输出)
该方法主要用于程序调试阶段:
通过该方法可以将程序的运行过程记录到文件中,以便自己分析MATLAB程序存在何种问题。
关于插桩技术的引用可以参考:【python算法】迪杰斯特拉算法 python实现-CSDN博客
主要利用输出语句
matlab
print_log = fopen('test_record.txt','a','n','UTF-8');
fprintf(print_log, "\n\ntime: %s\n", datestr(now,0)); % 输出程序运行时间
fprintf(print_log, "******************************************\n" + ...
"Algorithm"\n********************************************\n"); % 输出分割线
fprintf(print_log, 'the Astar cost value is %d. \n', AStar_cost);
fprintf(print_log, 'the ThetaStar cost value is %d. \n', ThetaStar_cost);
fclose(print_log); % 记得关闭文件