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

📄 resmtx.m

📁 PLS_Toolbox是用于故障检测与诊断方面的matlab工具箱
💻 M
字号:
function [resmat,res] = resmtx(x,p)
%RESMTX calculates the residuals contributions for PCA
%RESMTX calculates E from the PCA model X = TP'+E
%  Given the inputs of the data matrix (x) and the
%  PCA loadings (p) RESMTX calculates the
%  residuals matrix (resmat) as E = X(I-PP') where
%  resmat = E and the Q residuals (res).
%
%I/O: [resmat,res] = resmtx(x,p);
%  
%  Note: The data matrix (x) must be scaled in a similar
%  manner to the data used to determine the loadings (p).
%
%See also: PCA, PCAPRO, TSQMTX

%Copyright Eigenvector Research, Inc. 1996-98

[mx,nx]  = size(x);
[mp,np]  = size(p);
if mp ~= nx
  error('Size of x and p not compatible')
end
resmat = x*p;
resmat = resmat*p';
resmat = x - resmat;
res    = sum((resmat.^2)')';

⌨️ 快捷键说明

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