'Tag' , 'Axes1Text3' , ...
'VerticalAlignment' , 'baseline' );
set(get(h2, 'Parent' ), 'YLabel' ,h2);
h2 = text( 'Parent' ,h1, ...
'Color' ,[0 0 0], ...
'HandleVisibility' , 'off' , ...
'HorizontalAlignment' , 'right' , ...
'Position' ,mat2, ...
'Tag' , 'Axes1Text2' , ...
'Visible' , 'off' );
set(get(h2, 'Parent' ), 'ZLabel' ,h2);
h2 = text( 'Parent' ,h1, ...
'Color' ,[0 0 0], ...
'HandleVisibility' , 'off' , ...
'HorizontalAlignment' , 'center' , ...
'Position' ,[0.4978165938864628 1.064814814814815 9.160254037844386], ...
'Tag' , 'Axes1Text1' , ...
'VerticalAlignment' , 'bottom' );
set(get(h2, 'Parent' ), 'Title' ,h2);
h1 = uicontrol( 'Parent' ,h0, ...
'Units' , 'normalized' , ...
'FontName' , ' 隶书 ' , ...
'FontSize' ,13, ...
'HorizontalAlignment' , 'left' , ...
'ListboxTop' ,0, ...
'Position' ,[0.55 0.8 0.2 0.12], ...
'String' , ' 输入绘图指令 ' , ...
'Style' , 'text' , ...
'Tag' , 'StaticText1' );
h1 = uicontrol( 'Parent' ,h0, ...
'Units' , 'normalized' , ...
'BackgroundColor' ,[.752941176470588 .752941176470588 .752941176470588], ...
'Callback' , 'close(gcbf)' , ...
'ListboxTop' ,0, ...
'Position' ,[0.5869921874999999 0.12 0.16 0.15], ...
'String' , 'Close' , ...
'Tag' , 'Pushbutton2' );
if nargout > 0, fig = h0; end
(2)配套数据文件
[Myguizzy.m]
function Myguizzy
% 假如 Mygui1.m 所在目录不是 d:\matbook5\mdisk ,那么第 <10> 条就应做相应的改变。
% 一定要保证本函数生成的 Mygui1.mat 与 Mygui1.m 在同一目录。
mat0=jet(64);
mat1=[ 0 0 1.0000
0 0.5000 0
1.0000 0 0
0 0.7500 0.7500
0.7500 0 0.7500
0.7500 0.7500 0
0.2500 0.2500 0.2500];
mat2=[-0.1179 1.3056 9.1603];
save d:\matbook5\mdisk\Mygui1 %<10>
(3)如何利用本节所提供的文件产生图 11.6.2-1 所示的界面
1、把本节提供的 Mygui1.m , Myguizzy.m , Mycolormap.m , Myapply.m , Myedit.m 五个文件放在 MATLAB 的搜索路径上。
2、先运行 Myguizzy.m ,创建数据文件 Mygui1.mat 。
3、运行 Mygui1.m ,就可得到符合要求的界面。 |