standvec.m
来自「收集的GA的一些源程序」· M 代码 · 共 25 行
M
25 行
function z = standvec(x)
%
% STANDVEC
%
% Standardises a vector x, ie. the mean of x is
% subtracted from all elements of x and the
% result is divided by the standard deviation of x.
%
% Called: z = standvec(x)
%
% Only for vectors!
[rows,cols]=size(x);
if cols==1
meanx=ones(size(x))*mean(x);
stdx = std(x);
z=(x-meanx)/stdx;
else
disp('Error:')
disp(' Only for vectors')
disp(' ')
end;
clear meanx, stdx;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?