![]() |
请教一个参数传递的问题
我是个matlab初学者,正在学习GUI方面的知识。我做了一个简单计算的界面,但是不会参数传递。在此请求能得到大家的帮助。谢谢你们了!!!
这段是 编辑界面的程序 Text(4)=uicontrol(f6,'units','normalized','backgroundcolor','g','style','text','string','螺旋叶片的导程计算','fontsize',9,'fontweight','bold','position',[0.3,0.38,0.3,0.05]); Pubutt(48)=uicontrol(f6,'units','normalized','backgroundcolor',[0.7 0.7 0.7],'style','pushbutton','string','滚筒的有效直径(m)','fontsize',9,'fontweight','bold','position',[0.1,0.26,0.44,0.07]); Pubutt(49)=uicontrol(f6,'units','normalized','backgroundcolor',[0.7 0.7 0.7],'style','pushbutton','string','螺旋叶片的螺旋升角(度)','fontsize',9,'fontweight','bold','position',[0.1,0.16,0.44,0.07]); Edit(48)=uicontrol(f6,'units','normalized','backgroundcolor','w','style','edit','string',[],'position',[0.59,0.26,0.15,0.07]); Edit(49)=uicontrol(f6,'units','normalized','backgroundcolor','w','style','edit','string',[],'position',[0.59,0.16,0.15,0.07]); h_confirm9=uicontrol(f6,'units','normalized','style','pushbutton','string','计算','fontsize',9,'fontweight','bold','position',[0.5,0.04,0.2,0.1],'callback',@confirm9); Edit(50)=uicontrol(f6,'units','normalized','backgroundcolor','w','style','edit','string',[],'position',[0.7,0.04,0.2,0.1],'visible','off'); hu(6)=uipanel(f6,'position',[0.07,0.04,0.88,0.43]); function confirm9(obj,event) set(Edit(50),'visible','on') end end 相应的计算所用的function 函数文件我也写了一个,如下 function Dsr=youxiaozhijing(D,lp) % Dsr为滚筒的有效直径 % D为滚筒直径 % lp为截齿露出齿座外在滚筒径向上的长度值 Dsr=0.5*(D+D-2*lp) end |
回复: 请教一个参数传递的问题
2 个附件
这是界面的截图,当输入那两个参数的时候,怎么调用function函数,实现它的计算,并将计算结果显示在计算按钮后面的那个空白text 控件里
|
回复: 请教一个参数传递的问题
[QUOTE=tianya6421;25745]这是界面的截图,当输入那两个参数的时候,怎么调用function函数,实现它的计算,并将计算结果显示在计算按钮后面的那个空白text 控件里[/QUOTE]
要么没有返回值 要么值没有连接 后者可能性大 |
所有时间均为北京时间。现在的时间是 11:05。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.