Hannah
Hannah

Reputation: 137

Matlab - Trouble using multiple timers

Hi I am writing a program on matlab which uses multiple timers. Each timer calls a different function.

I have

t = timer('Period', 0.1,...
                     'StartDelay',1,...
        'ExecutionMode', 'fixedRate',...
        'TimerFcn',@moverobots)...

t1 = timer('Period', 0.1,...
        'StartDelay',1,...
        'ExecutionMode', 'fixedRate',...
        'TimerFcn',@moveintruder)...

t2 = timer('Period', 0.1,...
        'StartDelay',1,...
        'ExecutionMode', 'fixedRate',...
        'TimerFcn',@moveintruderout)...

start(t);

start(t1);

start(t2);

My problem is that when I run my program start(t) is underlined and I get following error:

"Parse error at start: usage might be invalid MATLAB syntax"

t has well is underlined and message says

"value assigned to variable 't' might be unused"

I have noticed that if I get rid of t2 and start(t2) I do not get this error and the program works. Whats wrong? Thanks

Upvotes: 0

Views: 368

Answers (1)

μολὼν.λαβέ
μολὼν.λαβέ

Reputation: 668

at the end if each timer you have 3 dots which is the continuation characters. so essentially combining all the functions to one giant mess. t=() not t=()...

Upvotes: 1

Related Questions