help-octave
[Top][All Lists]
Advanced

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

terminate routine


From: Herr Oswald
Subject: terminate routine
Date: Fri, 22 Feb 2019 12:23:12 +0100

Hello,

a dear friend of mine (who is familiar with matlab) wrote a few lines
to analyse tempo variations in musical recordings.

One problem he could not get around is how to terminate the routine. At
present this is solved with a timeout of 10s.

When started, the routine writes time stamps into an array whenever a
key is pressed. What we now need is a handle to terminate the process
by a special key with the contents of the array preserved - ctrl-C or
ctrl-D seem not to work.

This is the code:

<raw>f=figure;
pause(0.05);
set(f,'Position',[1 1 2 2]);
time=0;
coll=[];
tic;
while time<10
    waitforbuttonpress;
    time=toc;
    tic;
    coll=[coll time];
end
coll
col=60./coll;
close(f);
plot(col(1:end-1))</raw>

We would be very grateful for a brief hint.

Cheers,
Wolf




reply via email to

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