GPRINTF is a general replacement for the built-in fprintf function. In addition to printing to a file or the command window, GPRINTF can print formatted output to one or more display windows. Each display window has automatic scroll bars and can be independantly positioned and editted. This distribution includes an S-function wrapper for use with Simulink.
File: open, save, save as, close
Edit: cut, copy, paste, clear
Format: font, wrap (on/off)
Automatic vertical / horizontal scroll bars
Full access to text and display properties via object handle.
>> gprintf(-1,'pi is approximately = %6.4f\n',pi)
>> gprintf(-1,'HELLO WORLD\n')
creates "Display Box 1" with the string "pi is approximately = 3.1416" on the first line and "HELLO WORLD" on the second line. Use the pull-down menus to customize the display or save its contents to a file.
Mark Brown (2021). GPRINTF (https://www.mathworks.com/matlabcentral/fileexchange/1780-gprintf), MATLAB Central File Exchange. Retrieved .
I would like to make the text box scroll down with each new line, at the moment it seems to stay at line 1 and new lines go off bottom of the box. Any ideas on how to fix this??
Maybe jprintf is the newest version but I still prefer gprintf.
Inconvenient of jprintf is that you can not change window properties like Name etc directly. (or you need to know how to do this with Java commands)
I prefer the "old" gprintf. here you get a real Matlab figure and can change its properties via usual Matlab commands.
With R2008a I had to move :
hact = actxcontrol('Forms.TextBox.1',[0 0 400 200]);
it seems that by setting the resizefcn the resizefcn callback is executed.
A Matlab bug?
With this modification, function works perfectly.
Please see JPRINTF (by the same author) as well. JPRINTF is done entirely in Java and should be more portable across platforms.
This module provides an excellent tool for displaying Text and Numerics in a window.
After updating two files as recommended in the package, I was fully able to use the package
as defined in the abstract. This is an EXCELLENT !!! package.
I only features that I would add to the package, would be the Print Preview and Print cabability
via the drop down menu of the module.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!