📄 addmcols.m
字号:
% ADDMCOLS - Add unobserved columns to PCA solution%% [ S_new, Sv_new, Isv_new ] = ADDMCOLS( S, Sv, Ic, n2x, Isv ) adds% the columns removed by RMEMPTY to the found parameter S.%% See also RMEMPTY, ADDMROWS% This software is provided "as is", without warranty of any kind.% Alexander Ilin, Tapani Raikofunction [ S_new, Sv_new, Isv_new ] = addmcols( S, Sv, Ic, n2x, Isv );ncomp = size(S,1);% Might not be very efficientIc2 = setdiff( 1:n2x, Ic );S_new = zeros(ncomp, n2x);S_new(:,Ic) = S;if iscell(Sv) if nargin < 5 | isempty(Isv) Sv_new = cell(1,n2x); for j = 1:length(Ic) Sv_new{Ic(j)} = Sv{j}; end for j = 1:length(Ic2) Sv_new{Ic2(j)} = eye(ncomp); end Isv_new = []; else Sv_new = Sv; Sv_new{length(Sv)+1} = eye(ncomp); Isv_new = repmat( length(Sv_new), 1, n2x ); Isv_new(Ic) = Isv; endelse % Sv is a vector of the diagonal elements of a covariance % matrix Sv_new = repmat( 1, size(S,1), n2x ); Sv_new(:,Ic) = Sv;end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -