time | Calls | line |
---|
| | 1 | function [pcmd,dev] = printopt(varargin)
|
| | 2 | %PRINTOPT Printer defaults.
|
| | 3 | % PRINTOPT is a MATLAB file that you or your system manager can
|
| | 4 | % edit to indicate your default printer type and destination.
|
| | 5 | %
|
| | 6 | % [PCMD,DEV] = PRINTOPT returns two strings, PCMD and DEV.
|
| | 7 | % PCMD is a string containing the print command that
|
| | 8 | % PRINT uses to spool a file to the printer. Its default is:
|
| | 9 | %
|
| | 10 | % Unix: lpr -r
|
| | 11 | % Windows: COPY /B LPT1:
|
| | 12 | % Macintosh: lpr -r (Mac OS X 10.2 and higher)
|
| | 13 | % Print -Mps (Mac OS X 10.1)
|
| | 14 | %
|
| | 15 | % Note: Solaris users who do not use BSD printing, i.e. lpr,
|
| | 16 | % need to edit this file and uncomment the line to specify 'lp -c'.
|
| | 17 | %
|
| | 18 | % DEV is a string containing the default device option for
|
| | 19 | % the PRINT command. Its default is:
|
| | 20 | %
|
| | 21 | % Unix: -dps2
|
| | 22 | % Windows: -dwin
|
| | 23 | % Macintosh: -dps2
|
| | 24 | %
|
| | 25 | % See also PRINT.
|
| | 26 |
|
| | 27 |
|
| | 28 | % Copyright 1984-2011 The MathWorks, Inc.
|
| | 29 | % The MathWorks, Inc. grants permission for Licensee to modify
|
| | 30 | % this file. Licensee's use of such modified file is subject
|
| | 31 | % to the terms and conditions of The MathWorks, Inc. Software License
|
| | 32 | % Booklet.
|
| | 33 | %
|
| | 34 |
|
| | 35 | % Initialize options to empty matrices
|
< 0.001 | 24 | 36 | pcmd = []; dev = [];
|
| | 37 |
|
| | 38 | % This file automatically defaults to the dev and pcmd shown above
|
| | 39 | % in the online help text. If you would like to set the dev or pcmd
|
| | 40 | % default to be different from those shown above, enter it after this
|
| | 41 | % paragraph. For example, pcmd = 'lpr -s -r -Pfred' would change the
|
| | 42 | % default for Unix systems to send output to a printer named fred.
|
| | 43 | % Note that pcmd is ignored by the Windows drivers.
|
| | 44 | % See PRINT.M for a complete list of available devices.
|
| | 45 |
|
| | 46 | %---> Put your own changes to the defaults here (if needed)
|
| | 47 |
|
| | 48 | % ----------- Do not modify anything below this line ---------------
|
| | 49 | % The code below this line automatically computes the defaults
|
| | 50 | % promised in the table above unless they have been overridden.
|
| | 51 |
|
< 0.001 | 24 | 52 | if isempty(pcmd)
|
| | 53 |
|
| | 54 | % For Unix and Mac OS X 10.2+
|
< 0.001 | 24 | 55 | pcmd = 'lpr -r';
|
| | 56 |
|
| | 57 | % For Windows
|
< 0.001 | 24 | 58 | if ispc
|
| | 59 | def_printer = system_dependent('getdefaultprinter');
|
| | 60 | if ~isempty(def_printer) && ~strcmp(def_printer,'FILE:')
|
| | 61 | pcmd = ['COPY /B %s ' def_printer];
|
| | 62 | else
|
| | 63 | pcmd = 'COPY /B %s LPT1:';
|
| | 64 | end
|
< 0.001 | 24 | 65 | end
|
| | 66 |
|
| | 67 |
|
| | 68 | % For Solaris
|
| | 69 | %cname = computer;
|
| | 70 | %if strcmp(cname(1:3),'SOL'), pcmd = 'lp -c'; end
|
< 0.001 | 24 | 71 | end
|
| | 72 |
|
< 0.001 | 24 | 73 | if isempty(dev)
|
| | 74 |
|
| | 75 | % For Windows
|
< 0.001 | 24 | 76 | if ispc
|
| | 77 | dev = '-dwin';
|
< 0.001 | 24 | 78 | else
|
| | 79 | % For Unix, and Macintosh
|
< 0.001 | 24 | 80 | dev = '-dprn';
|
< 0.001 | 24 | 81 | end
|
< 0.001 | 24 | 82 | end
|
Other subfunctions in this file are not included in this listing.