command window refresh in R015b

조회 수: 2 (최근 30일)
Joris Gillis
Joris Gillis 2016년 3월 30일
댓글: adams13 2024년 3월 27일
Dear all,
For our numerical software, we've coupled a C++ library with MATLAB. Every few seconds, that library has some useful output, that we send to the command window (mexPrintf).
We've come to rely on calling drawnow('update') after every print to make sure that the output of the library streams live, line-by-line, into the command window, instead of being buffered (appearing in chunks of a good number of lines at a time).
Now, a user of our software reports that this mechanism stopped working between R2015a, and R2015b. I've checked the release notes but could not find a clue that would explain this.
Any hints for me?
Best regards, Joris Gillis

채택된 답변

Walter Roberson
Walter Roberson 2016년 3월 30일

추가 답변 (1개)

Jan
Jan 2016년 3월 30일
A workaround is calling an M-helper function: http://www.mathworks.com/matlabcentral/answers/255615#answer_215636
  댓글 수: 2
Joris Gillis
Joris Gillis 2016년 3월 30일
편집: Joris Gillis 2016년 3월 30일
Hi Jan, in that answer you talk about 'java methods'. Does this mean you already explored the following unexposed-feature route?
desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
cmdwin = desktop.getClient('Command Window');
xwin = cmdwin.getComponent(0).getViewport.getComponent(0);
xwin.repaint
Best, Joris
Disclaimer: I'm on R204b myself, so I can only trust the gurus on their word..
adams13
adams13 2024년 3월 27일
Thank you for a nice solution, it works also in 2023. Redraw only the command window is definitely better than all figures with 'drawnow'. However, Matlab R2023b says
'com.mathworks' package and subpackages will be removed in a future release. There is no simple replacement for this.
Any solution for a current version?

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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by