erp_per.m

来自「绝对经典,老外制作的功能强大的matlab实现PLS_TOOBOX」· M 代码 · 共 15 行

M
15
字号
function pct=erp_per(s)

% syntax erp_per(s)
% calculates proportion crossblock covar accounted for

[r,c]=size(s);
if (r==c | c>1); %1st case is the normal "s", 2nd case is for section of posthoc "s"
s =diag(s);
pct=(s.^2/sum(s.^2));
else		%have a single vector, as in the output from the permutation test.
   s=s;
   pct=(s.^2/sum(s.^2));
end

⌨️ 快捷键说明

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