help-octave
[Top][All Lists]
Advanced

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

Re: Getting 'for' loop to print only once using echo/diary


From: Jordi Gutiérrez Hermoso
Subject: Re: Getting 'for' loop to print only once using echo/diary
Date: Thu, 8 Mar 2012 14:34:42 -0500

On 1 March 2012 11:07, Martin Senator <address@hidden> wrote:
> I am using a 'for' loop in a script (because I can't
> get 'roots' to work on a vector).

What problem are you facing here?

> I start an interactive Octave session with:
>       $ octave -q
> Then I issue the command (junk.m is the name of the script file):
>       octave:1> diary on, echo on, more off,junk
> The last two lines of the script are:
>      [now] = ctime(time) #;
>      diary off
> After the script runs Octave is ready for more interactive commands.
> But, the 'for' loop is in the 'diary' file 101 times.
>
> What can I do to get the desired behavior?

I can't think of an easy way to do this with diary, but perhaps you
could just write your program in a script from the beginning?

- Jordi G. H.


reply via email to

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