bssuda 发表于 2007-3-15 14:23

图形界面程序问题

clf reset
H=axes('unit','normalized','position',,'visible','off');
set(gcf,'currentaxes',H);
h_fig=get(H,'parent');
 set(h_fig,'unit','normalized','position',);
 h_axes=axes('parent',h_fig,...
    'unit','normalized','position',,...
    'xlim',,'ylim',,'fontsize',8);
h_text=uicontrol(h_fig,'style','text',...
    'unit','normalized','position',,...
    'horizonal','left','string','zeta=');
h_edit=uicontrol(h_fig,'style','edit',...
    'unit','normalized','position',,...
    'horizonal','left',...
    'callback',[...
    'z=str2num(get(gcbo,"string"));'...
    't=0:0.1:15;',...
    'for k=1:length(z);',...
    's2=tf(1,);',...
    'y(:,k)=step(s2,t);',...
    'plot(t,y(:,k));',...
    'if(length(z)>1),hold on, end,',...
    'end;',...
    'hold off,']);
h_push1=uicontrol(h_fig,'style','push',...
    'unit','normalized','position',,...
    'string','grid on','callback','grid on');
h_push2=uicontrol(h_fig,'style','push',...
    'unit','normalized','position',,...
    'string','grid off','callback','grid off');

运行后:
??? Error using ==> uicontrol
Invalid uicontrol property: 'horizonal'.
第9行:h_text=uicontrol(h_fig,'style','text',...出现错误.
  我是GUI菜鸟,MATLAB新手,请高人指点,谢谢!

eight 发表于 2007-3-15 19:46

原帖由 bssuda 于 2007-3-15 14:23 发表
clf reset
H=axes('unit','normalized','position',,'visible','off');
set(gcf,'currentaxes',H);
h_fig=get(H,'parent');
 set(h_fig,'unit','normalized','position',);
 h_axes=axes('parent',h_fig ...


uicontrol 这个控件没有 'horizonal' 属性,自己help一下吧
页: [1]
查看完整版本: 图形界面程序问题