在命令窗口中禁用自动滚动 [英] Disable auto-scrolling in command window

查看:108
本文介绍了在命令窗口中禁用自动滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Matlab中编写的许多代码都有非常冗长的输出.程序运行时,信息将打印到命令窗口,并且在每一行中,该窗口都会自动滚动到底部.当我想更仔细地阅读某些输出或向上滚动以查看较早的输出时,这将成为一个问题.我可以向上滚动,但只能等到打印出新的一行为止,这通常不到一秒钟.

A lot of the code that I write in Matlab has a very verbose output. As the program runs, information is printed to the command window, and with each new line, the window automatically scrolls to the bottom. This becomes a problem when I want to read some of the output more closely or scroll up to look at older output. I can scroll up, but only until a new line is printed, which is often less than a second.

有人知道是否有可能在Matlab窗口中关闭此自动滚动吗?根据机器的不同,我使用多种不同的Matlab版本工作,而所有这些版本都会发生这种情况.答案可能是否",但我发誓我记得曾经拥有此功能.

Does anyone know if it is possible to turn off this automatic scrolling in the Matlab window? I work in a number of different Matlab versions, depending on the machine, and this happens with all of them. The answer to this might be "No", but I swear I remember having this functionality at one point.

推荐答案

您可能会发现此解决方法很有用.

You may find this workaround useful.

首先使用命令行启动Matlab matlab -logfile 'myLog.txt'( doc 说,它启动MATLAB并以文件名将任何输出的副本复制到命令窗口.这包括所有崩溃报告."

First launch matlab using the command line matlab -logfile 'myLog.txt' (the doc says it "starts MATLAB and makes a copy of any output to the Command Window in filename. This includes all crash reports.")

然后使用支持自动刷新内容的文本编辑器打开您的.txt文件(参见图片).在OSX上,我使用TextWrangler(可从 www 免费获得),但据报道其他人对此有此要求功能(请参见此处

Then open your .txt file using a text editor supporting automatic refresh of content (see picture). On OSX I use TextWrangler (freely available at www) but others have been reported to have this feature (see here or here).

结果:在Matlab控制台和文本编辑器上都打印输出显示(fprintf,disp,而不是命令本身)(稍有滞后,刷新文件的时间少于一半)第二,我会说我的配置).而且,没有自动滚动.这样的过程似乎并没有影响脚本的整体性能(尽管可能值得测试).

Results: output displays (fprintf, disp, but not the commands per se) are printed both on the Matlab console and the text editor (file is refreshed with a little lag time, below half a second I would say with my configuration). And there is no automatic scrolling. Such procedure does not seem to impact the overall performance of the script (although it may deserve some testing).

这篇关于在命令窗口中禁用自动滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆