bryan 发表于 2006-4-18 15:16

[求助]callback到底应该怎么写?

<DIV >关于uicontrol里面的callback,到底应该怎么写?<BR>1.<BR>H=axes('units','normalized','position', ,'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',);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',,...<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,,t);',...<BR>'plot(t,y(:,k));',...<BR>'if (length(z)&gt;1) ,hold on,end,',...<BR>'end;',...<BR>'hold off,']);<BR><BR>2.H=axes('units','normalized','position', ,'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',);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',,...<BR>'horizontal','left',...<BR>'callback',[...<BR>'z=str2num(get(gcbo,''string''));');<BR><BR>两个为什么就不一样?我的意思是用Z保存输入的字符,可是为什么第二个程序就不能显示出可以编辑的输入框,并且有提示,第一个可以显示输入框?怎么修改才成?<BR><BR>callback的调用程序有什么要求?<BR><BR><BR>麻烦大家了,实在因为这个看了好长时间也不懂</DIV><!-- / message --><!-- sig -->

hankmat 发表于 2006-4-18 16:28

callback

H=axes('units','normalized','position', ,'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',);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',,...<BR>'horizontal','left',...<BR>'callback',<FONT color=#f70909>[</FONT>...<BR>'z=str2num(get(gcbo,''string''));');<BR><BR>这里怎么有<FONT color=#f70909>[<BR><FONT color=#000000>是多了吧!</FONT><BR></FONT>

bryan 发表于 2006-4-18 17:47

应该是<BR>'callback',<BR>'z=str2num(get(gcbo,''string''));');<BR><BR>对不起<BR>是多了个<BR>

F117_ren_0 发表于 2006-4-18 18:50

<P>??? Error using ==&gt; Untitled1<BR>Error using ==&gt; vertcat<BR>All rows in the bracketed expression must have the same <BR>number of columns.<BR>括号里表达式的所有行必须有相同数目的列!~<BR>在用cellback的时候用"["就要用"]"结束!~!~</P>

flybaly 发表于 2006-4-18 20:35

<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', ,'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',);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',,...<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,,t);',...<BR>'plot(t,y(:,k));',...<BR>'if (length(z)&gt;1) ,hold on,end,',...<BR>'end;',...<BR>'hold off,']);<BR><BR>2.H=axes('units','normalized','position', ,'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',);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',,...<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', ,'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',);<BR>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',,...<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>

bryan 发表于 2006-4-19 10:16

<STRONG><FONT face=Verdana color=#61b713>flybaly</FONT></STRONG>
<P>谢谢你。可是,为什么在指定位置不出现我要的编辑输入框呢?</P>

happy 发表于 2006-4-20 19:28

回复:(bryan)[求助]callback到底应该怎么写?

<P>H=axes('units','normalized','position', ,'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',);</P>
<P>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',,...<BR>'horizontal','left',...<BR>'callback',['z=str2num(get(gcbo,"string"));']);</P>
页: [1]
查看完整版本: [求助]callback到底应该怎么写?