help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab Script Files


From: Paul Kienzle
Subject: Re: Matlab Script Files
Date: Sat, 1 Jan 2005 23:52:58 -0500

Hubert,

The first arg. to fprintf needs to be the unit number returned from
an fopen call, or a string if printing to standard output.  You can
also print to stdout or stderr.

If you are on a unix-like system (including cygwin) you can use sed
to transform your files:

        mkdir trans
for f in *.m ; do sed -e"s/fprintf *[(]'pri*[0-9]',/fprintf(stdout,/g" < $f > trans/$f; done

The files in the directory trans should contain proper fprintf statements.

        - Paul

On Dec 31, 2004, at 1:29 PM, Hubert Fitch wrote:

------------------------------------------------------------
Examples of formatted print sttements.
 
fprintf('pri0',' mass_electron          %18e',mass_electron);
fprintf('pri0','  kilograms \n')

fprintf('pri0',' space_impedance        %18e',space_impedance);
fprintf('pri0','  Ohms \n')

% unitsx.m  
fprintf('prifile0','filename=units.m   UNITS/DIMENSIONS/Definitions    \n\n'); fprintf('prifile0','Newton = Force                        kg*meter/sec^2 \n');



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]