matlab的gui一个button使程序暂停再按一下继续执行
text=get(hObject,'String');%Ifthesimulationwererunning:ifstrcmp(text,'暂停')==1set(hObj...
text = get(hObject, 'String');
% If the simulation were running:
if strcmp(text, '暂停') == 1
set(hObject, 'String', '继续');
% pause it:
waitforbuttonpress;
set(hObject, 'String', '暂停');
else
% otherwise, "resume" it:
set(hObject, 'String', '暂停');
end;
return;
这是我从网上找的一个,只能暂停,暂停后不能继续运行,我是新手就大神指导 展开
% If the simulation were running:
if strcmp(text, '暂停') == 1
set(hObject, 'String', '继续');
% pause it:
waitforbuttonpress;
set(hObject, 'String', '暂停');
else
% otherwise, "resume" it:
set(hObject, 'String', '暂停');
end;
return;
这是我从网上找的一个,只能暂停,暂停后不能继续运行,我是新手就大神指导 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询