声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1178|回复: 6

[GUI界面] [求助]请教界面制作高手!!!!

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

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

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

x
  1. hf=figure('color',[0,1,1],'position',[100 200 400 200],...'name','shuzhizhaunghuan','numberTitle','off','menubar','none');
  2. uicontrol(hf,'style','Text','Units','normalized',...'position',[0.05 0.8 0.45 0.1],'horizontal','center',...'string','shurukuang','back',[0 1 1]);
  3. uicontrol(hf,'style','Text','Units','normalized',...'position',[0.5 0.8 0.45 0.1],'horizontal','center',...'string','shucukuang','back',[0 1 1]);
  4. uicontrol(hf,'style','Frame','position',[0.04 0.33 0.45 0.45],...'Units','normalized','back',[1 1 0]);
  5. uicontrol(hf,'style','Text','position',[0.05 0.6 0.25 0.1],... 'Units','normalized','horizontal','center',...'string','shijinzhis','back',[1 1 0]);
  6. uicontrol(hf,'style','Text','position',[0.05 0.4 0.25 0.1],... 'Units','normalized','horizontal','center',...'string','2jinzhis','back',[1 1 0]);
  7. he1=uicontrol(hf,'style','Edit','position',[0.25,0.6,0.2,0.1],... 'Units','normalized','back',[0 1 0]);
  8. he2=uicontrol(hf,'style','Edit','position',[0.25,0.4,0.2,0.1],... 'Units','normalized','back',[0 1 0]);
  9. uicontrol(hf,'style','Frame','position',[0.52 033 0.45 0.45],...'Units','normalized','back',[1 1 0]);
  10. ht=uicontrol(hf,'style','Text','position',[0.6 0.5 0.3 0.1],...'horizontal','center','Units','normalized','back',[0 1 0]);
  11. COMM=['n=str2num(get(he1,"sting"));','b=st2num(get(he2,"string"));'...'dec=trdec(n,b);'set(ht,"string",dec);'];
  12. uicontrol(hf,'style','push','position',[0.18 0.1 0.2 0.12],...'string','zhuanhuan','Units','normalized','call',COMM);
  13. uicontrol(hf,'style','push','position',[0.65 0.1 0.2 0.12],...'string','tuichu','Units','normalized','call','close(hf)');
复制代码

回复
分享到:

使用道具 举报

 楼主| 发表于 2006-5-30 11:22 | 显示全部楼层
看看上面的程序,哪个地方错了
不胜感激!!!!
做一个界面的
 楼主| 发表于 2006-5-30 14:47 | 显示全部楼层
还有一个m文件我没有发上去 要调用的trdec.m 文件我没有发
trdec.m文件肯定没有错误
发表于 2006-5-30 16:18 | 显示全部楼层
怎么贴的代码乱乱的,没办法看,先把代码整理清楚了
 楼主| 发表于 2006-5-30 18:16 | 显示全部楼层
  1. hf=figure('color',[0,1,1],'position',[100 200 400 200],...
  2. 'name','数字转换','numberTitle','off','menubar','none');
  3. uicontrol(hf,'style','Text','Units','normalized',...
  4. 'position',[0.05 0.8 0.45 0.1],'horizontal','center',...
  5. 'string','输入筐','back',[0 1 1]);
  6. uicontrol(hf,'style','Text','Units','normalized',...
  7. 'position',[0.5 0.8 0.45 0.1],'horizontal','center',...
  8. 'string','输出筐','back',[0 1 1]);
  9. uicontrol(hf,'style','Frame','position',[0.04 0.33 0.45 0.45],...
  10. 'Units','normalized','back',[1 1 0]);
  11. uicontrol(hf,'style','Text','position',[0.05 0.6 0.25 0.1],...
  12. 'Units','normalized','horizontal','center',...
  13. 'string','十进制','back',[1 1 0]);
  14. uicontrol(hf,'style','Text','position',[0.05 0.4 0.25 0.1],...
  15. 'Units','normalized','horizontal','center',...
  16. 'string','2和16进制','back',[1 1 0]);
  17. he1=uicontrol(hf,'style','Edit','position',[0.25,0.6,0.2,0.1],...
  18. 'Units','normalized','back',[0 1 0]);
  19. he2=uicontrol(hf,'style','Edit','position',[0.25,0.4,0.2,0.1],...
  20. 'Units','normalized','back',[0 1 0]);
  21. uicontrol(hf,'style','Frame','position',[0.52 033 0.45 0.45],...
  22. 'Units','normalized','back',[1 1 0]);
  23. ht=uicontrol(hf,'style','Text','position',[0.6 0.5 0.3 0.1],...
  24. 'horizontal','center','Units','normalized','back',[0 1 0]);
  25. COMM=['n=str2num(get(he1,"string"));','b=str2num(get(he2,"string"));',...
  26. 'dec=trdec(n,b);','set(ht,"string",dec);'];
  27. uicontrol(hf,'style','push','position',[0.18 0.1 0.2 0.12],...
  28. 'string','转换','Units','normalized','callback','COMM');
  29. uicontrol(hf,'style','push','position',[0.65 0.1 0.2 0.12],...
  30. 'string','退出','Units','normalized','call','close(hf)');
复制代码
 楼主| 发表于 2006-5-30 18:18 | 显示全部楼层
界面出来了
但是调用的函数文件没有起作用!!!!
发表于 2006-5-30 20:59 | 显示全部楼层
我这里没有trdec这个程序,没办法帮你调试
不过你这个问题和帖子
http://forum.vibunion.com/thread-8938-1-1.html
给的例子是一模一样的,你参照修改一下
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-11-20 09:43 , Processed in 0.074905 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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