%diary使用例子
>> diary 'mylog.txt' %打开日志记录命令窗口
>> disp('add this into mylog')
add this into mylog
>> 1+1
ans =
2
>> diary off %关闭了日志,不再记录
>> disp('this will not log')
this will not log
>> diary on %重新打开日志记录
>> disp('this will be log')
this will be log
>> disp('this will be log')
this will be log
>> diary off %关闭,保存记录
请发表评论