Is there a way to turn off the command window's autoscroll during a function's execution

조회 수: 15 (최근 30일)
I'm running 2017b. I can't just pause because I have a PCT app running in a parfor loop and so, I think, that's why the Pause button doesn't show. I want to look back up the command window to see something printed out earlier but the running function is spewing stuff to the command window constantly so I can't scroll back through the command window without it autoscrolling back in about a second. That's unworkable.
  댓글 수: 3
Andrew Diamond
Andrew Diamond 2018년 1월 19일
This is a pretty standard occurrence for R&D apps where GUIs etc are not yet in place (and may never be). Things like optimization where the default is to print out to the command window not to mention unstructured print info that allows the developer to quickly get a sanity check.
I guarantee you this happens a lot but for most people it's been mitigated by the advent of the "Pause" button. However, apparently, when using parfor this isn't an option (I don't really know why I don't see the pause button so that's a guess).
Anyway, I wasn't looking for a value judgement.
Walter Roberson
Walter Roberson 2018년 1월 19일
There have certainly been times when I wanted some output to pause long enough for me to read it but I was stymied because the program was producing output that was triggering autoscroll.

댓글을 달려면 로그인하십시오.

답변 (2개)

Steven Lord
Steven Lord 2018년 1월 19일
Do you need to view the displayed text while the application is running, or is the problem you're trying to solve the fact that you can't scroll the screen buffer back far enough to see that text by the end of the application's run (because it wrote too much text in the Command Window?)
In the latter case, you can start MATLAB with the -logfile option, use the diary function to write the displayed information to a file, or create a function named something like writeToLog that uses low-level file I/O functions to write the information to a log file in a format of your choice rather than displaying everyting in the Command Window.
  댓글 수: 3
Don
Don 2018년 7월 5일
I use timers a lot and the data is displayed in the command window. I start a diary file when the timer starts running. I can open the diary file with a text editor and can see anything that happened when the time is still running

댓글을 달려면 로그인하십시오.


Andrew Diamond
Andrew Diamond 2018년 7월 5일
I'll give that a whirl Thanks.

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by