Octave-4.2.1 problem with "pause" command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Octave-4.2.1 problem with "pause" command

Ying-Foon Chow (FEG)
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);
end


That 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.

YF

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Octave-4.2.1 problem with "pause" command

Doug Stewart-4


On Sun, Jul 16, 2017 at 10:00 AM, Ying-Foon Chow (FEG) <[hidden email]> 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);
end


That 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.

YF


this works nice for me in Ubuntu

tt=linspace(-1,1,1024);
plot(tt,exp(tt)),grid
title('exponential function')
hold on                              ## I added this
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);
end

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Octave-4.2.1 problem with "pause" command

Doug Stewart-4


On Sun, Jul 16, 2017 at 10:19 AM, Doug Stewart <[hidden email]> wrote:


On Sun, Jul 16, 2017 at 10:00 AM, Ying-Foon Chow (FEG) <[hidden email]> 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);
end


That 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.

YF


this works nice for me in Ubuntu

tt=linspace(-1,1,1024);
plot(tt,exp(tt)),grid
title('exponential function')
hold on                              ## I added this
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);
end


I get a nice zoom in at 0,0

To make the pause release you must click in the command window of octave and then press enter.

--
DAS


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Octave-4.2.1 problem with "pause" command

Doug Stewart-4


On Sun, Jul 16, 2017 at 10:24 AM, Doug Stewart <[hidden email]> wrote:


On Sun, Jul 16, 2017 at 10:19 AM, Doug Stewart <[hidden email]> wrote:


On Sun, Jul 16, 2017 at 10:00 AM, Ying-Foon Chow (FEG) <[hidden email]> 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);
end


That 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.

YF


this works nice for me in Ubuntu

tt=linspace(-1,1,1024);
plot(tt,exp(tt)),grid
title('exponential function')
hold on                              ## I added this
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);
end


I get a nice zoom in at 0,0
That should say (0,1)
To make the pause release you must click in the command window of octave and then press enter.

--
DAS




--
DASCertificate for 206392


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Octave-4.2.1 problem with "pause" command

Doug Stewart-4


On Sun, Jul 16, 2017 at 10:31 AM, Doug Stewart <[hidden email]> wrote:


On Sun, Jul 16, 2017 at 10:24 AM, Doug Stewart <[hidden email]> wrote:


On Sun, Jul 16, 2017 at 10:19 AM, Doug Stewart <[hidden email]> wrote:


On Sun, Jul 16, 2017 at 10:00 AM, Ying-Foon Chow (FEG) <[hidden email]> 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);
end


That 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.

YF


this works nice for me in Ubuntu

tt=linspace(-1,1,1024);
plot(tt,exp(tt)),grid
title('exponential function')
hold on                              ## I added this
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);
end


I get a nice zoom in at 0,0
That should say (0,1)
To make the pause release you must click in the command window of octave and then press enter.

--
DAS






If you don't want to use so much CPU time then try this

tt=linspace(-1,1,1024);
plot(tt,exp(tt)),grid
title('exponential function')
hold on                              ## I added this
pause
t0=clock;t=0;
while t<20
    axis([0 0 1 1]+exp(-t/5)*[-1 1 -1 1])
    drawnow
    pause(.1)    # add this to reduce CPU usage
    t=etime(clock,t0);
end

 

--
DAS




--
DASCertificate for 206392


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Octave-4.2.1 problem with "pause" command

Ying-Foon Chow (FEG)
In reply to this post by Ying-Foon Chow (FEG)
Thank you for your help.

YF


On Sun, Jul 16, 2017 at 10:38 PM, Doug Stewart <[hidden email]> wrote:
On Sun, Jul 16, 2017 at 10:00 AM, Ying-Foon Chow (FEG) <[hidden email]> 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);
end


That 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.

YF


this works nice for me in Ubuntu

tt=linspace(-1,1,1024);
plot(tt,exp(tt)),grid
title('exponential function')
hold on                              ## I added this
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);
end


I get a nice zoom in at 0,0
That should say (0,1)
To make the pause release you must click in the command window of octave and then press enter.

--
DAS



If you don't want to use so much CPU time then try this

tt=linspace(-1,1,1024);
plot(tt,exp(tt)),grid
title('exponential function')
hold on                              ## I added this
pause
t0=clock;t=0;
while t<20
    axis([0 0 1 1]+exp(-t/5)*[-1 1 -1 1])
    drawnow
    pause(.1)    # add this to reduce CPU usage
    t=etime(clock,t0);
end

--
DASCertificate for 206392



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Loading...