No BSD License  

Highlights from
GPRINTF

5.0

5.0 | 5 ratings Rate this file 3 Downloads (last 30 days) File Size: 5.8 KB File ID: #1780
image thumbnail

GPRINTF

by Mark Brown

 

31 May 2002 (Updated 14 Oct 2005)

General replacement for fprintf which allows printing formatted text to separate editable window.

| Watch this File

File Information
Description

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.

Features include:
  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.

Example:
   >> 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.

MATLAB release MATLAB 6.5 (R13)
Other requirements GPRINTF requires MS Windows and MS Forms ActiveX library to be installed. MS Forms normally installs with any MS Office product. If Matlab crashes, see Solution Number 33525 for more information.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
08 Jun 2002  
24 Jun 2003 Daniel K. O'Brien

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.

Dan

21 Oct 2005 Mark Brown

Please see JPRINTF (by the same author) as well. JPRINTF is done entirely in Java and should be more portable across platforms.

30 Jul 2008 Thierry Dalon

With R2008a I had to move :
set(hfig,'resizefcn','gprintf(0,''position'');');
after:
hact = actxcontrol('Forms.TextBox.1',[0 0 400 200]);
        setappdata(hfig,'ActiveXHandle',hact);

it seems that by setting the resizefcn the resizefcn callback is executed.
A Matlab bug?
With this modification, function works perfectly.
         

30 Jul 2008 Thierry Dalon

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.
(set(gcf,'Name',...))

17 Sep 2010 Ronan Costello

Nice function.

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??

R

Please login to add a comment or rating.
Updates
09 Dec 2002

This new release corrects a problem when accessing COM object fonts under Matlab 6.5 (Release 13).

31 Dec 2002

This new release corrects a problem when accessing COM object fonts under Matlab 6.5 (Release 13).

14 Oct 2005

GPRINTF has been superseded by JPRINTF. The new JPRINTF has the same functionality, but is completely written in Java and is platform independent. GPRINTF users are urged to switch to JPRINT. GPRINTF will no longer be maintained.

Tag Activity for this File
Tag Applied By Date/Time
development environment Mark Brown 22 Oct 2008 06:45:10
fprintf Mark Brown 22 Oct 2008 06:45:10
display Mark Brown 22 Oct 2008 06:45:10
simulink Mark Brown 22 Oct 2008 06:45:10
text Mark Brown 22 Oct 2008 06:45:10
simulink Tim Ziegele 17 Aug 2009 08:55:45

Contact us at files@mathworks.com