[1866] in Athena Bugs

home help back first fref pref prev next nref lref last post

matlab printing does not work

daemon@ATHENA.MIT.EDU (drmorris@ATHENA.MIT.EDU)
Tue Mar 7 16:06:20 1989

From: <drmorris@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
Cc: ellis@ATHENA.MIT.EDU
Date: Tue, 07 Mar 89 16:05:38 EST
Hello,

	The print.m file for matlab, which executes the print command
has a problem.  It tries to create a temporary file in the current
directory, but also requires that the commands 'gpp' and 'print.m' be in
the current directory.  Since /mit/courseware/matlab is read only, the
only way to get something to print out is to copy 'gpp' and 'print.m' to
your home directory or '/usr/tmp' and print out from there.

	The fix: a new print.m file with /tmp:
----------
%PRINT      Send the graph currently on the screen to a local printer.
%     If no argument is specified, the plot is sent to the default printer.
%     To print on a specific printer, pass the postscript printer name as
%       a quoted string:
%                print('linus')
%
function print(printer)

meta /tmp/metatmp                 % Put current plot into temporary metafile
!csh -c "gpp /tmp/metatmp -dps"   % Invoke GPP, creating device specific output
delete /tmp/metatmp.met           % Delete temporary metafile
if nargin == 0
 !lpr -r /tmp/metatmp.ps          % Spool device specific output to printer
else
 eval(['!lpr -r -P',printer,' /tmp/metatmp.ps'])
end
----------

I have *no* matlab programing experience, so don't blindly put into
matlab without looking at it.  However, it seems to work.

		Athena Consultant
		Dave Morrison


home help back first fref pref prev next nref lref last post