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

📄 ssa_view_principal_components.m

📁 主成分分析和偏最小二乘SquaresPrincipal成分分析( PCA )和偏最小二乘( PLS )
💻 M
字号:
function ssa_view_principal_components(SSA,comp_No);
% SSA_VIEW_PRINCIPAL_COMPONENTS(SSA,comp_No) plot principal components of SSA
% example: ssa_view_principal_components(SSA,[1 3 4 5 7 9]);
%
% last modified 10.02.05


str={};
for i=1:length(SSA.singular_numbers)
    str{i}=num2str(i);
end
if nargin<2
	[selection,ok] = listdlg('PromptString','Select principal vectors:',...
               'SelectionMode','multiple','ListString',str);
else
    ok=1;
    selection=comp_No;
end

if ok
	N=length(selection);
	Fignumbs=floor(N/3);
	Additaxes=mod(N,3);
	tempHandleA=[];
	tempHandleF=[];
	for i=1:Fignumbs
        tempHandleF(i)=figure('Units','characters',...
            'Name',['Principal components: ' num2str(selection(3*(i-1)+1)) ',' num2str(selection(3*(i-1)+2)) ',' num2str(selection(3*(i-1)+3))],...
            'NumberTitle','off','color',[1 1 1]);
        for j=1:3
            tempHandleA=[tempHandleA subplot(3,1,j)];
            plot(SSA.singular_numbers(selection(3*(i-1)+j))*SSA.V(:,selection(3*(i-1)+j))), grid on
            ylabel(num2str(selection(3*(i-1)+j)));
        end
	end
	if Additaxes==1
        tempHandleF(end+1)=figure('Units','characters',...
            'Name',['Principal components: ' num2str(selection(3*Fignumbs+1))],...
            'NumberTitle','off','color',[1 1 1]);
	end
	if Additaxes==2
        tempHandleF(end+1)=figure('Units','characters',...
            'Name',['Principal components: ' num2str(selection(3*Fignumbs+1)) ',' num2str(selection(3*Fignumbs+2))],...
            'NumberTitle','off','color',[1 1 1]);
	end
	for i=1:Additaxes
        tempHandleA=[tempHandleA subplot(3,1,i)];
        plot(SSA.singular_numbers(selection(3*Fignumbs+i))*SSA.V(:,selection(3*Fignumbs+i))), grid on
        ylabel(num2str(selection(3*Fignumbs+i)));
	end
	set(tempHandleA,'fontsize',8,'xlim',[1 length(SSA.V(:,1))]);
end

⌨️ 快捷键说明

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