test.m
来自「这是盲信号的代码 都已经通过编译了 做这方面的同仁可以参考一下 我觉得蛮惯用的」· M 代码 · 共 60 行
M
60 行
function test()
%2006.3.16
% Configuration options
FIGURENAME = 'GUI测试系统';
FIGURETAG = 'f_test';
SCREENSIZE = get(0,'ScreenSize');
FIGURESIZE = [round(0.1*SCREENSIZE(3)) (SCREENSIZE(4)-round(0.1*SCREENSIZE(4))-370) 200 150];
% Create the figure
a = figure('Color',[0.8 0.8 0.8], ...
'PaperType','a4letter', ...
'Name', FIGURENAME, ...
'NumberTitle', 'off', ...
'Tag', FIGURETAG, ...
'Position', FIGURESIZE, ...
'MenuBar', 'none');
% Create the frames
pos_l=2;
pos_w=FIGURESIZE(3)-4;
pos_h=FIGURESIZE(4)-4;
pos_t=FIGURESIZE(4)-2-pos_h;
h_f_background = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Position',[pos_l pos_t pos_w pos_h], ...
'Style','frame', ...
'Tag','f_background');
pos_l=4;
pos_w=192;
pos_h=106;
pos_t=FIGURESIZE(4)-4-pos_h;
h_f_mixed = uicontrol('Parent',a, ...
'BackgroundColor',[0.701961 0.701961 0.701961], ...
'Position',[pos_l pos_t pos_w pos_h], ...
'Style','frame', ...
'Tag','f_mixed');
pos_h=34;
pos_t=FIGURESIZE(4)-(106+4+2)-pos_h;
h_f_white = uicontrol('Parent',a, ...
'BackgroundColor',[1 0 0], ...
'Position',[pos_l pos_t pos_w pos_h], ...
'Style','frame', ...
'Tag','f_white');
%**************增加按钮**************************
bgc = get(h_f_mixed, 'BackgroundColor');
pos_l=20;
pos_t=80;
pos_w=150;
pos_h=40;
b = uicontrol('Parent',a, ...
'BackgroundColor',bgc, ...
'Callback','gui_test showmixed', ...
'HorizontalAlignment','left', ...
'Position',[pos_l pos_t pos_w pos_h], ...
'String','混合信号', ...
'FontSize',16,...
'Tag','t_mixed');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?