【matlab】怎么记录和保存运行结果 |
您所在的位置:网站首页 › matlab循环记录数据 › 【matlab】怎么记录和保存运行结果 |
在程序运行过程中,很多时候需要查看运行结果和中间过程,可以用写入txt或者excel文件中。但对于有很多中间过程的情况存在效率不高或者很多中间过程记录困难的问题。我发现了diary这个命令可以很好的解决这个问题。diary这个语句可以以文本文件的形式记录command window 这个窗口显示的运行结果全部记录下来,便于以后的查看。
比如要记录一下运行信息:
Optimize a model with 40 rows, 16 columns and 116 nonzeros Coefficient statistics: Matrix range [1e+00, 4e+01] Objective range [2e+00, 1e+01] Bounds range [1e+00, 1e+00] RHS range [1e+00, 4e+01] Found heuristic solution: objective 718 Presolve removed 20 rows and 4 columns Presolve time: 0.00s Presolved: 20 rows, 12 columns, 96 nonzeros Variable types: 0 continuous, 12 integer (6 binary) Root relaxation: objective 4.580000e+02, 9 iterations, 0.00 seconds Nodes | Current Node | Objective Bounds | Work Expl Unexpl | Obj Depth IntInf | Incumbent |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |