tprintf -- Print to Second Terminal Window

Version (4.64 KB) by Petorr
Print lines of text in secondary windows resembling command window.
Updated 8 Aug 2014

View License

Terminal Print
c = tprintf( FigureName, Text );
tprintf( 'MyMessages', 'Hello world in 2nd terminal!' );
sends text 'Hello world in 2nd terminal!' to a window with the name MyMessages.
Clear the window: call without 2nd argument:
tprintf( FigureName );

Create window if it does not exist:

tprintf( FigureName , '' );

Requires external function findjobj(), provided by Yair Altman online from Matlab File Exchange

Peter Adany 2014

Cite As

Petorr (2024). tprintf -- Print to Second Terminal Window (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Entering Commands in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

minor update; no features altered

Removed %# from comments because they were causing pragma warnings.

Code clarity / minor adjustments

Minor improvements & code cleanup.

14317 acknowledgement

Added ability to clear the window by calling without 2nd argument.