matlab GUI控件设计中,在调用pushbutton按钮callback,提示错误,求解答
h_main=figure('name','ademoof','menubar','none','numbertitle','off','position',[100,1...
h_main=figure('name','a demo of','menubar','none','numbertitle','off','position',[100,100,300,100]);
h_edit=uicontrol('style','edit','backgroundcolor',[1,1,1],'position',[20,20,50,20],...
'tag','myedit','string','1','horizontal','left');
h_but1=uicontrol('style','pushbutton','position',[20,50,50,20],'string','INC',...
'callback',['h=findobj(gcf,"tag","myedit");','v=eval(get(h,"string"));','set(h,"string",int2str(v+1));']);
??? Error using ==> h=findobj(gcf,"tag","myedit");v=eval(get(h,"string"));set(h,"string",int2str(v+1));
Error: The input character is not valid in MATLAB statements or expressions.
??? Error while evaluating uicontrol Callback 展开
h_edit=uicontrol('style','edit','backgroundcolor',[1,1,1],'position',[20,20,50,20],...
'tag','myedit','string','1','horizontal','left');
h_but1=uicontrol('style','pushbutton','position',[20,50,50,20],'string','INC',...
'callback',['h=findobj(gcf,"tag","myedit");','v=eval(get(h,"string"));','set(h,"string",int2str(v+1));']);
??? Error using ==> h=findobj(gcf,"tag","myedit");v=eval(get(h,"string"));set(h,"string",int2str(v+1));
Error: The input character is not valid in MATLAB statements or expressions.
??? Error while evaluating uicontrol Callback 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询