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

📄 standvec.m

📁 遗传算法的源程序
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -