How to prevent the function within a Timer to keep displaying the answer in Command Windows?
1 次查看(过去 30 天)
显示 更早的评论
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,
0 个评论
回答(1 个)
Azzi Abdelmalek
2013-2-4
编辑:Azzi Abdelmalek
2013-2-4
Try
a=MyFuc(Input);
set(handles.edit3,'String',num2str(a));
tmr=timer('Period',10,'ExecutionMode','FixedRate',...
'TimerFcn',);
start(tmr); % Start the timer object.
7 个评论
Azzi Abdelmalek
2013-2-4
编辑:Azzi Abdelmalek
2013-2-4
This is not displayed by MyFunc like you said in your question
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!