<DIV><FONT color=#ee1169>MY WAY:</FONT><br>function MainFunctionFigure<br>clc<br>close all<br>global handles1 handles2<br>hMainFig=figure('numbertitle','off','menubar','none','units','normalized','tag','hMainFig');<br>set(hMainFig,'units','normalized','position',[.2,.2,.6,.6]);<br>set(hMainFig,'defaultuicontrolfontname','隶书');<br>set(hMainFig,'defaultuicontrolfontsize',13);<br>set(hMainFig,'defaultuicontrolunits','normalized');<br>hPush1=uicontrol(hMainFig,'style','push','string','参数设定',...<br> 'tag','hPush1','position',[.1,.1,.2,.1]);<br>hPush2=uicontrol(hMainFig,'style','push','string','退出程序',...<br> 'tag','hPush2','position',[.6,.1,.2,.1]);<br>hEditShow=uicontrol(hMainFig,'style','edit','unit','normalized',...<br> 'position',[.4,.4,.2,.1],'tag','hEditShow','string','0');<br>set(hPush2,'callback','close all');<br>set(hPush1,'callback','SubFunctionFigure');<br>handles1=guihandles(hMainFig);<br>guidata(hMainFig,handles1);<br><br><br>=====================================================================<br></DIV>
<DIV>function SubFunctionFigure(handles)<br>global handles1 handles2<br>hParFig=figure('numbertitle','off','menubar','none');<br>hParEdit=uicontrol(hParFig,'style','edit','units','normalized','position',...<br>[.4,.4,.2,.1],'tag','hParEdit','string','12');<br>hParPush3=uicontrol(hParFig,'style','push','string','参数传递','tag',...<br>'hParPush3','units','normalized','position',[.1,.1,.2,.1]);<br>set(hParPush3,'callback',[...<br> 'global handles1 handles2,',...<br> 'set(handles1.hEditShow,''userdata'',get(handles2.hParEdit,''string''));',...<br> 'strPar=get(handles2.hParEdit,''string'');',...<br> 'set(handles1.hEditShow,''string'',strPar);',...<br> 'close gcf,',...<br> ]);<br><br>handles2=guihandles(hParFig);<br>guidata(hParFig,handles2);</DIV>注:存储为两个M文件,运行第一个。虽然不是完全的解决方案,不过图像不图像的无非是矩阵数据的传递,道理一样。
[此贴子已经被作者于2006-6-4 20:01:48编辑过]
|