📄 standardise.m
字号:
function Xs = standardise(X)
%function Xs = standardise(X)
%
% Standardises the data in X, by making column means equal to 0
% and column variances equal to 1
%
%INPUTS
% X = the data matrix containing ell samples (the rows) and N
% coordinates (ell x N)
% Xs = the standardised version of X
%
%
%For more info, see www.kernel-methods.net
% original data stored in ell x N matrix X
% output uses the same variable X
% M is a row vector storing the column averages
% SD stores the column standard deviations
ell = size(X,1);
M = sum(X) / ell;
M2 = sum(X.^2)/ell;
SD = sqrt(M2 - M.^2);
X = (X - ones(ell,1)*M)./(ones(ell,1)*SD);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -