我设计了一个Pushbutton,刚开始显示“开始”,点击之后显示“暂停”,再点击之后显示“开始”,machine1start=uicontrol(machine1,...'Style','Pushbutton',...'Position',[50,180,80,30],...'String','开始',...'CallBack',...['k=get(machine1start,''String'');'...'if (k==''开始''); '...'set(machine1start,''String'',''暂停'');'...'else ;',...'set(machine1start,''String'',''开始'');'...]);运行错误:??? Error using ==> k=get(machine1start,'String');if (k=='开始'); set(machine1start,'String','暂停');else;set(machine1start,'String','开始');Error: The input character is not valid in MATLAB statements or expressions.??? Error while evaluating uicontrol Callback
1 回答
呼如林
TA贡献1798条经验 获得超3个赞
使用函数uicontrol比如:clc; clear all; close all;
figure;
hb = uicontrol(gcf, 'style', 'pushbutton', ...
'units', 'normalized', ...
'position', [0.55,0.65,0.22,0.05], ...
'string', '按钮');
- 1 回答
- 0 关注
- 84 浏览
添加回答
举报
0/150
提交
取消