help-octave
[Top][All Lists]
Advanced

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

Re: monitoring iterations


From: James Sherman Jr.
Subject: Re: monitoring iterations
Date: Sun, 19 Aug 2007 18:20:14 -0400

You have to flush the output to stdout.

Simply add the line
fflush();
after the disp statement.

That should do the trick.

James

On 8/19/07, antonio palestrini <address@hidden> wrote:
Recently I had to run very long
iterations so I wanted to display the numbers
of the loops (every 100 iterations) in order to figure out how long I
have to wait.
Something like

niter = 10^6;
for t = 1:niter
  [do something];
  if rem(niter,100) == 0
      disp(t);
  endif
endfor

I realized that it is useless since octave (2.1.72 and 2.9.13 on a
mac) ends the loop
before to print the numbers. In other terms,  it prints the loop
numbers only at the end of the iteration and not during it.
Did anyone note this behavior and know how to solve it?

Thanks
Antonio
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

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