声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1466|回复: 6

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

[复制链接]
发表于 2006-4-18 15:16 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
<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)&gt;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 -->
回复
分享到:

使用道具 举报

发表于 2006-4-18 16:28 | 显示全部楼层

callback

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',<FONT color=#f70909>[</FONT>...<BR>'z=str2num(get(gcbo,''string''));');<BR><BR>这里怎么有<FONT color=#f70909>[<BR><FONT color=#000000>是多了吧!</FONT><BR></FONT>
 楼主| 发表于 2006-4-18 17:47 | 显示全部楼层
应该是<BR>'callback',<BR>'z=str2num(get(gcbo,''string''));');<BR><BR>对不起<BR>是多了个<BR>[em04]
发表于 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>
发表于 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',[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)&gt;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>
 楼主| 发表于 2006-4-19 10:16 | 显示全部楼层
<STRONG><FONT face=Verdana color=#61b713>flybaly</FONT></STRONG>
<P>谢谢你。可是,为什么在指定位置不出现我要的编辑输入框呢?</P>
发表于 2006-4-20 19:28 | 显示全部楼层

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

<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]);</P>
<P>h_edit=uicontrol(h_fig,'style','edit',...<BR>'unit','normalized','position',[0.67,0.59,0.25,0.14],...<BR>'horizontal','left',...<BR>'callback',['z=str2num(get(gcbo,"string"));']);</P>
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-11-24 23:38 , Processed in 0.060060 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表