⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gui_text.m

📁 这是盲信号的代码 都已经通过编译了 做这方面的同仁可以参考一下 我觉得蛮惯用的
💻 M
字号:
function gui_text()



global g_ICA_name;
% initial values for them:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Configuration options
%FIGURENAME = 'FastICA';
FIGURENAME = '盲分离系统';
FIGURETAG = 'f_FastICA';
SCREENSIZE = get(0,'ScreenSize');
FIGURESIZE = [round(0.1*SCREENSIZE(3)) (SCREENSIZE(4)-round(0.1*SCREENSIZE(4))-370) 530 370];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Create the figure
a = figure('Color',[0.8 0.8 0.8], ...
	   'PaperType','a4letter', ...
	   'Name', FIGURENAME, ...
	   'NumberTitle', 'off', ...
	   'Tag', FIGURETAG, ...
	   'Position', FIGURESIZE, ...
	   'MenuBar', 'none');
 set (a, 'Resize', 'off');
 hf_FastICA_MAIN = a;

set(hf_FastICA_MAIN, 'HandleVisibility', 'callback');

% Create the frames
%all
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');

%first
pos_l=4;
pos_w=400;
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');

%second
pos_h=90;
pos_t=FIGURESIZE(4)-(106+4+2)-pos_h;
h_f_white = uicontrol('Parent',a, ...
  'BackgroundColor',[0.701961 0.701961 0.701961], ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'Style','frame', ...
  'Tag','f_white');

%third
pos_h=pos_t - 4 - 2;
pos_t=4;
h_f_ica = uicontrol('Parent',a, ...
  'BackgroundColor',[0.701961 0.701961 0.701961], ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'Style','frame', ...
  'Tag','f_ica');

%forth
pos_w=120;
pos_l=FIGURESIZE(3)-(pos_w+2+2);
pos_h=FIGURESIZE(4)-2*4;
pos_t=FIGURESIZE(4)-(4)-pos_h;
h_f_side = uicontrol('Parent',a, ...
  'BackgroundColor',[0.6 0.6 0.6], ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'Style','frame', ...
  'Tag','f_side');

% Controls in f_mixed
bgc = get(h_f_mixed, 'BackgroundColor');
pos_vspace = 6;
pos_hspace = 6;

%%混合信号信息
pos_frame=get(h_f_mixed, 'Position');
pos_l = pos_frame(1) + 6;
pos_h = 16;
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 6;
pos_w = 150;
b = uicontrol('Parent',a, ...
  'BackgroundColor',bgc, ...
  'HorizontalAlignment','left', ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'String','混合信号:', ...
  'FontWeight', 'bold', ...
  'Style','text', ...
  'Tag','t_mixed');

pos_l = pos_l + pos_w;
pos_w = 120;
ht_FastICA_mixedStatus = uicontrol('Parent',a, ...
  'BackgroundColor',bgc, ...
  'HorizontalAlignment','left', ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'String','没有加载信号', ...
  'Style','text', ...
  'Tag','t_mixedstatus');

mixed_numofsignal = uicontrol('Parent',a,...
    'BackgroundColor',bgc,...
    'HorizontalAlignment','center',...
    'Position',[pos_frame(1) + 6 pos_frame(2)+50 80 25],...
    'String','混合信号个数:',...
    'Style','text');
mixed_numofsample = uicontrol('Parent',a,...
    'BackgroundColor',bgc,...
    'HorizontalAlignment','center',...
    'Position',[pos_frame(1) + 6 pos_frame(2)+30 80 25],...
    'String','混合信号点数:',...
    'Style','text');
m_mixed_numofsignal = uicontrol('Parent',a,...
    'BackgroundColor',bgc,...
    'HorizontalAlignment','left',...
    'Position',[pos_frame(1) + 90 pos_frame(2)+50 30 25],...
    'String','0',...
    'Style','text');
m_mixed_numofsample = uicontrol('Parent',a,...
    'BackgroundColor',bgc,...
    'HorizontalAlignment','left',...
    'Position',[pos_frame(1) + 90 pos_frame(2)+30 80 25],...
    'String','0',...
    'Style','text');
trans_button = uicontrol('Parent',a,...
    'BackgroundColor',bgc,...
    'HorizontalAlignment','center',...
    'Position',[pos_frame(1) + 40 pos_frame(2)+6 60 25],...
    'String','转置',...
    'Style','pushbutton');

mix_plot_button = uicontrol('Parent',a,...
    'BackgroundColor',bgc,...
    'HorizontalAlignment','center',...
    'Position',[pos_frame(1) + 240 pos_frame(2)+6 100 25],...
    'String','混合信号波形',...
    'Style','pushbutton');


%%预处理
pos_frame=get(h_f_white, 'Position');
pos_l = pos_frame(1) + 146;
pos_h = 18;
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 16;
pos_w = 60;
b = uicontrol('Parent',a, ...
  'BackgroundColor',bgc, ...
  'HorizontalAlignment','left', ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'String','信号预处理', ...
  'FontWeight', 'bold', ...
  'Style','text', ...
  'Tag','t_white');

% buttons

pos_l = pos_frame(1) + 20;
pos_w = 80;
pos_h = 30;
pos_t = pos_frame(2) + pos_vspace;
b = uicontrol('Parent',a, ...
  'BackgroundColor',[0.701961 0.701961 0.701961], ...
  'Interruptible', 'off', ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'String','去均值', ...
  'Tag','b_DoPCA');

pos_l = pos_l + pos_w + 46;
b = uicontrol('Parent',a, ...
  'BackgroundColor',[0.701961 0.701961 0.701961], ...
  'Interruptible', 'off', ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'String','白化', ...
  'Tag','b_OrigDim');

pos_w = 120;
pos_h = 30;
pos_l = pos_frame(1) + pos_frame(3) - 6 - pos_w;
pos_t = pos_frame(2) + 6;
b = uicontrol('Parent',a, ...
  'BackgroundColor',[0.701961 0.701961 0.701961], ...
  'Interruptible', 'off', ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'String','处理后波形', ...
  'Tag','b_ShowWhite');    


% 选择盲分离算法
pos_frame=get(h_f_ica, 'Position');
pos_l = pos_frame(1)+5;
pos_h = 25;
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 10;
pos_w = 390;
htitle = uicontrol('Parent',a, ...
  'BackgroundColor',bgc, ...
  'HorizontalAlignment','center', ...
  'Position',[pos_l pos_t pos_w pos_h], ...
  'String','选择盲分离算法', ...
  'FontWeight', 'bold', ...
  'Style','text', ...
  'Tag','t_white');

h = uibuttongroup('Parent',a,'Position',[0 0 0.8 0.4],...
   'BackgroundColor',[0.7 0.7 0.7]);


pos_l = pos_frame(1)+20;
pos_h = 25;
pos_t = pos_frame(2) + pos_frame(4) - pos_h - 35;
pos_w = 100;

hr1=uicontrol('Parent',h,'style','radio',...   
   'string','Fast_ICA',...        
   'position',[pos_l,pos_t,pos_w,pos_h]); 

      
hr2=uicontrol('Parent',h,'style','radio',... 
  'string','jade_ICA',...       
  'position',[pos_l,pos_t-40,pos_w,pos_h]);

hr3=uicontrol('Parent',h,'style','radio',... 
  'string','Pearson_ICA',...        
  'position',[pos_l,pos_t-80,pos_w,pos_h]);

pos_l = pos_frame(1)+180;

hr4=uicontrol('Parent',h,'style','radio',...  
   'string','ogwe_ICA',...       
   'position',[pos_l,pos_t,pos_w,pos_h]);  

      
hr5=uicontrol('Parent',h,'style','radio',... 
  'string','EGLD_ICA',...      
  'position',[pos_l,pos_t-40,pos_w,pos_h]);

hr6=uicontrol('Parent',h,'style','radio',... 
  'string','MY_ICA',...    
  'position',[pos_l,pos_t-80,pos_w,pos_h]);

set(h,'SelectedObject',[]);  % No selection
set(h,'SelectionChangeFcn',@selcbk);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
pos_fram = get(h_f_side,'position');
pos_l = pos_fram(1)+20;
pos_t = pos_fram(2)+pos_fram(4)-40;
pos_w = 80;
pos_h = 25;
load_button = uicontrol('Parent',a,'style','pushbutton',...
    'string','Load Data',...
    'position',[pos_l,pos_t,pos_w,pos_h]);

pos_t = pos_t-50;
load_button = uicontrol('Parent',a,'style','pushbutton',...
    'string','Do ICA',...
    'Callback','GUI_txt', ...
    'position',[pos_l,pos_t,pos_w,pos_h]);


pos_t = pos_t-50;
load_button = uicontrol('Parent',a,'style','pushbutton',...
    'string','性能波形',...
    'position',[pos_l,pos_t,pos_w,pos_h]);

pos_t = pos_t-50;
load_button = uicontrol('Parent',a,'style','pushbutton',...
    'string','保存结果',...
    'position',[pos_l,pos_t,pos_w,pos_h]);

pos_t = pos_t-50;
load_button = uicontrol('Parent',a,'style','pushbutton',...
    'string','退出',...
     'position',[pos_l,pos_t,pos_w,pos_h]);



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -