📄 scale.m
字号:
function sx = scale(x,means,stds)
%SCALE Scales matrix as specified.
% Scales a matrix (x) using means (mx) and standard
% deviations (stds) specified.
%
%I/O: sx = scale(x,mx,stdx);
%
% If only two input arguments are supplied then the function
% will not do variance scaling, but only vector subtraction.
%
%I/O: sx = scale(x,mx);
%
%See also: AUTO, MDAUTO, MDMNCN, MDRESCAL, MDSCALE, MNCN, RESCALE
%Copyright Eigenvector Research, Inc. 1991-98
%Modified 11/93
%Checked on MATLAB 5 by BMW 1/4/97
[m,n] = size(x);
if nargin == 3
sx = (x-means(ones(m,1),:))./stds(ones(m,1),:);
else
sx = (x-means(ones(m,1),:));
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -