|
<DIV class=quote><B>以下是引用<I>bryan</I>在2006-4-18 15:16:32的发言:</B><BR>
<DIV>关于uicontrol里面的callback,到底应该怎么写?<BR>1.<BR>H=axes('units','normalized','position',[0,0,1,1] ,'visible','off');<BR>set(gcf,'currentaxes',H);<BR>str='\fontname{隶书}极点配置与状态观测器辅助工具';<BR>text(0.10,0.93,str,'fontsize',14);<BR>h_fig=get(H,'parent');<BR>set(h_fig,'units','normalized','position',[0.1,0.2,0.7,0.4]);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',[0.67,0.59,0.25,0.14],...<BR>'horizontal','left',...<BR>'callback',[...<BR>'z=str2num(get(gcbo,''string''));',...<BR>'t=0:0.1:15;',...<BR>'for k=1:length(z);',...<BR>'y(:,k)=step(1,[1 2*z(k) 1],t);',...<BR>'plot(t,y(:,k));',...<BR>'if (length(z)>1) ,hold on,end,',...<BR>'end;',...<BR>'hold off,']);<BR><BR>2.H=axes('units','normalized','position',[0,0,1,1] ,'visible','off');<BR>set(gcf,'currentaxes',H);<BR>str='\fontname{隶书}极点配置与状态观测器辅助工具';<BR>text(0.10,0.93,str,'fontsize',14);<BR>h_fig=get(H,'parent');<BR>set(h_fig,'units','normalized','position',[0.1,0.2,0.7,0.4]);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',[0.67,0.59,0.25,0.14],...<BR>'horizontal','left',...<BR>'callback',[...<BR>'z=str2num(get(gcbo,''string''));');<BR><BR>两个为什么就不一样?我的意思是用Z保存输入的字符,可是为什么第二个程序就不能显示出可以编辑的输入框,并且有提示,第一个可以显示输入框?怎么修改才成?<BR><BR>callback的调用程序有什么要求?<BR><BR><BR>麻烦大家了,实在因为这个看了好长时间也不懂</DIV><!-- / message --><!-- sig --></DIV>
<P>H=axes('units','normalized','position',[0,0,1,1] ,'visible','off');<BR>set(gcf,'currentaxes',H);<BR>str='\fontname{隶书}极点配置与状态观测器辅助工具';<BR>text(0.10,0.93,str,'fontsize',14);<BR>h_fig=get(H,'parent');<BR>set(h_fig,'units','normalized','position',[0.1,0.2,0.7,0.4]);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',[0.67,0.59,0.25,0.14],...<BR>'horizontal','left',...<BR>'callback',[...<BR>'z=str2num(get(gcbo,''string''));'<FONT size=5><FONT color=#0909f7>,...</FONT></FONT><FONT size=2>)</FONT>;<BR></P> |
|