Timer
- From: Finn <finnmckenna@xxxxxxxxxxx>
- Date: Fri, 21 Oct 2005 06:46:16 -0400
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
.
- Prev by Date: Re: Any independent meditor available for download?
- Next by Date: Re: Int 32 processing speed: Is it a bug
- Previous by thread: Re: Command to jump in mfiles
- Next by thread: Re: Timer
- Index(es):
Relevant Pages
|