help-octave
[Top][All Lists]
Advanced

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

Re: Plotting during iterations


From: Søren Hauberg
Subject: Re: Plotting during iterations
Date: Tue, 21 Aug 2007 15:30:19 +0200
User-agent: Thunderbird 1.5.0.12 (X11/20070604)

Rupert Swarbrick skrev:
Following on from Antonio's question earlier "monitoring iterations",
is there a way to get plots to come out during iterations?

In this case, I've got an unpleasant parameter estimation problem with
a few hundred iterations, each of which takes about 5-10 seconds and
can plot a graph at the end.

I would like to be able to see the graphs in turn (they can replace
each other!! I only want one up at once), to see how the graphs are
evolving.

Is this possible?
I think you can just call 'plot' inside your loop, and then call 'drawnow' to force the plot to be shown. Something like this (untested code):

for i = 1:10
  x = linspace(0, 2*pi);
  y = sin(i*x);
  plot(x, y);
  drawnow
endfor

Søren


reply via email to

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