help-octave
[Top][All Lists]
Advanced

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

disp() to a file?


From: John W. Eaton
Subject: disp() to a file?
Date: Tue, 27 Jun 2000 12:56:04 -0500 (CDT)

On  2-May-2000, Paul Kienzle <address@hidden> wrote:

| How do I print to a file from an m-file without knowing the type of the
| thing I'm printing?  disp(x) works fine to the terminal.  I seem to want
| disp(x,fid).

OK, in the current (2.1.x, CVS) sources, fdisp is now an M-file that
does this:

  function fdisp (fid, x)

    if (nargin == 2)
      fid << x << "\n";
    else
      usage ("fdisp (fid, x)");
    endif

  endfunction

and disp is just

  function disp (x)

    if (nargin == 1)
      fdisp (stdout, x)
    else
      usage ("disp (x)");
    endif

  endfunction

jwe



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

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



reply via email to

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