nib*_*bot 25
是.Matlab将您的命令历史记录存储history.m在"首选项文件夹"中调用的文件中,该文件包含首选项,历史记录和布局文件.您可以使用以下prefdir命令找到首选项文件夹:
>> prefdir
ans =
/home/tobin/.matlab/R2010a
Run Code Online (Sandbox Code Playgroud)
然后history.m使用您选择的机制搜索该目录中的文件.例如,在unix上使用grep:
>> chdir(prefdir)
>> !grep plot history.m
plot(f, abs(tf))
doc biplot
!grep plot history.m
Run Code Online (Sandbox Code Playgroud)
如果您只想使用GUI,也可以在命令历史记录窗口中使用搜索功能.
如果要以编程和平台无关的方式完成此任务,可以首先使用MATLAB的Java内部函数将命令历史记录作为字符数组获取:
history = com.mathworks.mlservices.MLCommandHistoryServices.getSessionHistory;
historyText = char(history);
Run Code Online (Sandbox Code Playgroud)
然后,您可以使用STRFIND或REGEXP等函数搜索您喜欢的字符数组.您还可以使用函数CELLSTR将字符数组转换为字符串的单元格数组(每个单元格一行),因为它们有时可以更容易使用.
| 归档时间: |
|
| 查看次数: |
10826 次 |
| 最近记录: |