How to prevent the function within a Timer to keep displaying the answer in Command Windows?

2 views (last 30 days)
Hi ALl
My code is shown as below
set(handles.edit3,'String',num2str(MyFuc(Input)));
tmr=timer('Period',10,'ExecutionMode','FixedRate',...
'TimerFcn',num2str(MyFuc(Input)));
start(tmr); % Start the timer object.
function Output=MyFuc(Input)
Output=Input*3;
end
Matlab's command window keeps display the answer from MyFuc. Anyone knows how can I stop command window displaying it?
Many Thanks,

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 4 Feb 2013
Edited: Azzi Abdelmalek on 4 Feb 2013
Try
a=MyFuc(Input);
set(handles.edit3,'String',num2str(a));
tmr=timer('Period',10,'ExecutionMode','FixedRate',...
'TimerFcn',);
start(tmr); % Start the timer object.
  7 Comments

Sign in to comment.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!