Timer



Hi,

I am attempting to execute a timer that will generate a number each
time it executes and will append this number and all other numbers
that it creates to an Array. The generated number is intended to
represent the number of times that the timer has executed. To create
the array I realise that I will be required to pass the preceding
array to the function from prior timer executions. In other words I
must pass the previous timers output to any subsequent timer
execution.

I have written the following code:

out1=1;
out2=[];

t=timer('StartDelay',1,'Period',1,'TasksToExecute',4,'ExecutionMode','
FixedRate');
t.TimerFcn={@thingy,out1,out2};
start(t);

function out=thingy(obj,Event,a)

b=a+1;
A=[a;b];

a=a+1;

out1 = a;
out2 = A;

Basically, what I want to do is use the outputs (out1, out2) as the
input arguments for the next execution of the timer function. By
doing this I want to build an array of time steps, A. The above code
is not working.

Can anyone help on this? Thanks.

Finn
.



Relevant Pages

  • Re: Debugging Challenge - no source available
    ... > custom controls. ... > few bitmap operations which use a timer to help time-slice so the UI ... > - the debugger stops at the Application.Runline, there's no call stack, ... > In both cases, the debugger catches execution at the same point, just ...
    (microsoft.public.dotnet.general)
  • Re: How to measure code execution time...?
    ... down clock, to get the execution time on a real processor. ... measure with an external timer. ...
    (comp.arch.embedded)
  • Window messages
    ... Load event handler set a timer for 200ms and the timer's Tick handler will ... In the execution of the Timer event I use a Process.WaitForExit function to ... window messages when my launcher application was running the timer event. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: UI display appears sluggish in multi-threaded app
    ... Note that I am assuming that at no point in this whole execution do you execute a ... API call in the main GUI thread. ... UI thread does SetTimer(1,3000,NULL) to start the timer. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Postscript questions
    ... It looks as if you believe the curly braces are defining a scope. ... Curly braces are behaving much more like the square brackets, the array "delimiters". ... The difference is deferred execution, ... Evaluating an executable name means that the interpreter searchs the name through the dictionnary stack and when found, evaluate the value associated with the name. ...
    (comp.lang.postscript)