声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1781|回复: 6

[GUI界面] 求助 GUI 界面设计中 Step函数的回调函数 急啊 帮帮忙

[复制链接]
发表于 2006-6-21 08:10 | 显示全部楼层 |阅读模式

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

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

x
各位 英雄 我做的是 离散控制系统的计算机辅助设计  
需要做一个GUI 界面  但是 Step 按钮 的回调函数 的编写 怎么弄啊???谢谢了
我今天一天都会守着论坛的 谢谢!!!!!!!!!
回复
分享到:

使用道具 举报

发表于 2006-6-21 08:24 | 显示全部楼层
如果你用uicontrol编辑界面的话可以参考
http://forum.vibunion.com/thread-17316-1-1.html

如果你用guide编辑界面的话,那么他会自动形成
类似于function step_Callback(hObject, eventdata, handles)
这样的函数头
你在下面写回调内容就行了
[此贴子已经被作者于2006-6-21 8:36:56编辑过]

 楼主| 发表于 2006-6-21 08:29 | 显示全部楼层
高手 谢谢你的回复, 有个回调函数 但是不能运行...
按钮dstep_pushbutton的回调程序如下:

  1. if q==1

  2. step(num,den); p=findobj('Tag','EditText1');

  3. systemstr = str2mat(...

  4. ' % Now it will get the step response of the system expressed by transfer function',...

  5. ' sys = tf(num,den);',...

  6. ' ');

  7. detailstr = str2mat(' ',' % Click on the line for response details');

  8. commandStr = str2mat(systemstr,...

  9. ' % Plot the step response of this system',...

  10. ' step(sys)',...

  11. detailstr);

  12. set(p,'String',commandStr);

  13. else

  14. step(a,b,c,d);


  15. p=findobj('Tag','EditText1');

  16. systemstr = str2mat(...

  17. ' % Now it will get the step response of the system expressed by state space model',...

  18. ' sys = ss(a,b,c,d);',...

  19. ' ');

  20. detailstr = str2mat(' ',' % Click on the line for response details');

  21. commandStr = str2mat(systemstr,...

  22. ' % Plot the step response of this system',...

  23. ' step(sys)',...

  24. detailstr);

  25. set(p,'String',commandStr);

  26. end
复制代码
发表于 2006-6-21 08:37 | 显示全部楼层
请把现象说明清楚,或者上传完整的代码
 楼主| 发表于 2006-6-21 08:49 | 显示全部楼层
这个就是完整的回调程序  可是运行不了....
我做的是 一个GUI界面  有关离散控制系统的计算机辅助设计
step 是阶跃响应 函数
发表于 2006-6-21 08:51 | 显示全部楼层
  1. 这个就是完整的回调程序  可是运行不了....
  2. 我做的是 一个GUI界面  有关离散控制系统的计算机辅助设计
  3. step 是阶跃响应 函数
复制代码

你这个只是回调程序,还有其他的
 楼主| 发表于 2006-6-21 08:54 | 显示全部楼层
其他的  请问 您 指得是什么啊??
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-9-25 11:23 , Processed in 0.054943 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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