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

📄 da_pcor.m

📁 王小平《遗传算法——理论、应用与软件实现》随书光盘
💻 M
字号:
%
% da_pcor.m
%
% Partial correlation screen
%
w1=gcf;
da_front;
drawnow;

%
% Now calculate the correlations
%
% All variables are included in this analysis
%
%
% Say it's calculating data
%
text1=uicontrol(w1,...
	'Style','text',...
	'Position',[230 300 150 15],...
	'String','Working. Please wait....',...
	'BackGroundColor',[0 0 0],...
	'ForeGroundColor',[1 1 1]);
[D L]=size(data);
pcs=pcorrm(data);
delete(text1);

%
% Now display somes axes
%
ax1=axes(...
	'Units','pixels',...
	'Position',[65 180 500 220],...
	'Box','on',...
	'Color',[0 0 0],...
	'Visible','on');

text1=da_text(w1,220,410,150,15,'Partial Correlation plot',[1 1 1],[1 0 0]);
text2=da_text(w1,365,65,200,15,'',[1 1 1],[0 0 1]);
text3=da_text(w1,365,45,200,15,'',[1 1 1],[0 0 1]);
set(text2,'visible','off');
set(text3,'visible','off');

sl1_value=1;
old_sl1_value=1;
%
% Plot the correlation of variable 1
%
bar(pcs(:,sl1_value));
Xlabel('Variable number');
Ylabel('Correlation coefficient');

%
% Set the ButtonDownFcn
%
da_pcorb;

%
% Slider to change the variable of interest
%
sl1=uicontrol(w1,...
	'Style','slider',...
	'Position',[100 50 200 20],...
	'Min',1,...
	'Max',L,...
	'Value',1,...
	'CallBack',[
		'set(sl1_current,''String'',ceil(get(sl1,''Value'')));',...
		'sl1_value=ceil(get(sl1,''Value''));',...
		'if sl1_value ~= old_sl1_value;',...
			'old_sl1_value=sl1_value;',...
			'set(sl1_current,''String'',num2str(ceil(sl1_value)));',...
			'bar(pcs(:,sl1_value));',...
			'Xlabel(''Variable number'');',...
			'Ylabel(''Correlation coefficient'');',...
			'set(text2,''visible'',''off'');',...
			'set(text3,''visible'',''off'');',...
			'da_pcorb;',...
		'end;']);

sl1_current=da_text(w1,280,70,20,15,'1',[1 1 1],[0 0 0]);
sl1_min=da_text(w1,85,50,15,15,'1',[1 1 1],[0 0 0]);
sl1_max=da_text(w1,305,50,20,15,num2str(L),[1 1 1],[0 0 0]);
sl1_title=da_text(w1,80,70,200,15,'View correlations with variable:',[1 1 1],[0 0 0]);

⌨️ 快捷键说明

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