|
From: | Ying-Foon Chow (FEG) |
Subject: | Re: Octave-4.2.1 problem with "pause" command |
Date: | Mon, 17 Jul 2017 17:26:37 +0800 |
--I get a nice zoom in at 0,0On Sun, Jul 16, 2017 at 10:00 AM, Ying-Foon Chow (FEG) <address@hidden> wrote:Hi,I am a new user using Octave 4.2.1 in Windows 7. Somehow the following program always hang my machine if I don't specify a time in the "pause" command:t=linspace(-1,1,1024);
plot(t,exp(t)),grid
title('exponential function')
pause
t0=clock;t=0;
while t<20
axis([0 0 1 1]+exp(-t/5)*[-1 1 -1 1])
drawnow
t=etime(clock,t0);
endThat is, I can't get the figure to "move" no matter what key I press. Thanks in advance for any advice that may be offered.YFThat should say (0,1)If you don't want to use so much CPU time then try thistt=linspace(-1,1,1024);plot(tt,exp(tt)),gridtitle('exponential function')hold on ## I added thispauset0=clock;t=0;while t<20axis([0 0 1 1]+exp(-t/5)*[-1 1 -1 1])drawnowpause(.1) # add this to reduce CPU usaget=etime(clock,t0);end
[Prev in Thread] | Current Thread | [Next in Thread] |