clear all,clc;
lastSeq = 15;
thisTimer = timer ;
thisTimer.Period = 1/2;
thisTimer.ExecutionMode = 'fixedRate';
thisTimer.UserData = 1;
thisTimer.TimerFcn = { @timer_update , lastSeq };
start ( thisTimer );

function timer_update ( myTimer , ~, lastSeq )
seq = myTimer.UserData ;
fprintf (1, '%2.0f | Hello world !\n', seq );
if seq == lastSeq
    stop ( myTimer );
end
myTimer.UserData = seq + 1;
end
