help-octave
[Top][All Lists]
Advanced

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

diary not saving all output on screen


From: Ada Cheng
Subject: diary not saving all output on screen
Date: Wed, 29 Oct 2003 06:53:17 -0500 (EST)

Good morning,
        As I am introducing students to Octave/Matlab, I am asking them to
run simple assignments.m files that I created.  They are suppose to save their
work using diary and submit those results.  However, with students using
Octave (I use Octave myself also but I have not use the diary commands
since my Matlab days) they are having problems with diary as not all
output on the screen are saved.  As a simple example suppose the following
is assignment.m
s=sprintf('Welcome.\n');
disp(s)
s=sprintf('To obtain a random 3x4 matrix, you simply type
A=rand(3,4).\n');
disp(s)
s=sprintf('Try it now.\n');
disp(s)
keyboard

When in Octave if I invoke:
octave-2.1.50:33> diary test.txt
octave-2.1.50:34> assignment
Welcome.

To obtain a random 3x4 matrix, you simply type A=rand(3,4).

Try it now.

debug> A=rand(3,4)
A =

  0.95518  0.95963  0.48468  0.57280
  0.50107  0.11943  0.30040  0.68138
  0.69698  0.68525  0.10297  0.90479

debug> return
octave-2.1.50:35> diary off
octave-2.1.50:36>

then the output in test.txt is:
octave-2.1.50:34> assignment
Welcome.

To obtain a random 3x4 matrix, you simply type A=rand(3,4).

Try it now.

A =

  0.95518  0.95963  0.48468  0.57280
  0.50107  0.11943  0.30040  0.68138
  0.69698  0.68525  0.10297  0.90479

octave-2.1.50:35> diary off

Therefore I am missing the two commands A=rand(3,4) and return.  The
output of rand(3,4) is display but not the actual commands.

Doing a help on diary indicates that it should:
Create a list of all commands _and_ the output they produce, mixed
     together just as you see them on your terminal.


Any help will be greatly appreciated.

Sincerely,
Ada

============================================================================
 Ada Cheng                              address@hidden
 Assistant Professor                    http://www.kettering.edu/~acheng
 Department of Science and Mathematics
 Kettering University
 1700 West Third Avenue
 Flint, Michigan 48504-4898
 U.S.A.
============================================================================



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