polarize.m

来自「多通道奇异谱分析程序」· M 代码 · 共 15 行

M
15
字号
function E=polarize(E);
% POLARIZE - assign a polarity to a vector.
% If the first element of the vector is < 0,
% the vector is multiplied by -1.
%
% If a matrix is input, each column is polarized.
%

[r,c]=size(E);

for i=1:c
  if E(1,i)<0, E(:,i)=-E(:,i); end
end

⌨️ 快捷键说明

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