displayInline

버전 1.0.0.0 (1.65 KB) 작성자: Damith Senaratne
Displays a string inline in the MATLAB Command Window, overwriting any text it previously displayed.
다운로드 수: 190
업데이트 2011/8/12

라이선스 보기

Displays a string inline in the command window, overwriting any output the method previously displayed.

Useful to update any displayed string in-place, for example to indicate the the state of a simulation in progress.

-----------------------------------
e.g.
displayInline;
tic;
for k = 1:1e6
if mod(k,1000)==0
displayInline(sprintf('test: iteration %d, elapsed time: %g s', k, toc));
end
...
RepeatSomeTimeConsumingTask;
...
end
displayInline(sprintf('test: completed %d iterations (in %g s)', k, toc));
-----------------------------------

A persistent variable 'displayInlineCount' is used to keep track of the length of the previously displayed string, so that it can be erased the next time.

'displayInlineCount' is reset if no argument is passed in or 'str' is null.

Note: Any output on the command window made by other functions (e.g. display) between successive calls to displayInline would cause an incorrect portion of the output to be overwritten.

인용 양식

Damith Senaratne (2026). displayInline (https://kr.mathworks.com/matlabcentral/fileexchange/32510-displayinline), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2010a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Characters and Strings에 대해 자세히 알아보기
버전 게시됨 릴리스 정보
1.0.0.0