如果是以下代码:
hf=figure('position',[200 200 600 400],...
'name','gui_hd','numbertitle','off');
ha=axes('position',[0.4 0.1 0.5 0.7],'box','on');
hbsin=uicontrol(hf,'style','pushbutton','position',[50 140 100 30],'string','plot sin(x)','callback',...
['x=0:0.1:4*pi;' 'plot(x,sin(x));' 'axis([0 4*pi -1 1]);']);
hbcos=uicontrol(hf,'style','pushbutton','position',[50 100 100 30],'string','plot cos(x)','callback',...
['x=0:0.1:4*pi;' 'plot(x,cos(x));' 'axis([0 4*pi -1 1]);'])
显示运行正常。
但是我想在绘制图形的时候加上xlabel('x'),ylabel('y')
编制如下代码:
hf=figure('position',[200 200 600 400],...
'name',