gscaler.m

来自「PLS_Toolbox是用于故障检测与诊断方面的matlab工具箱」· M 代码 · 共 22 行

M
22
字号
function [gx] = gscaler(newdata,mx,stdx)
%GSCALER group scales a new matrix.
%  GSCALER scales a matrix (newdata) using a vector
%  of means (mx) and a vector of standard deviations
%  (stdx), and returns the resulting matrix (gx).
%  (mx) is subtracted from each row of newdata the result
%  is divided by sqrt(sum(stdx.^2)). GSCALER is typically
%  used to scale new MPCA data to the mean and variance
%  of previously analyzed MPCA data.
%
%I/O:  [gx] = gscaler(newdata,mx,stdx);
%
%See Also: GSCALE, DOGSCL, DOGSCLR, RESCALE, SCALE

%Copyright Eigenvector Research, Inc. 1996-98

[m,n] = size(newdata);
stdt  = stdx.^2;
stdt  = sqrt(sum(stdt));
gx    = (newdata-mx(ones(m,1),:))/stdt;

⌨️ 快捷键说明

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