normalize.m

来自「最新的模式识别分类工具箱,希望对朋友们有用!」· M 代码 · 共 27 行

M
27
字号
% ---------------------------------------------------------------- % FUNCTION   normalize% ---------------------------------------------------------------- %		normalizes the rows of a matrix% Usage: %	        outmat = normalize(inmat)% Input:%		inmat = column vector of row vectors% Output:%% __________________________%  Author: Vittorio Castelli%  Copyright IBM T. J. Watson Research Center%      January 27, 1995;	Last modified: January 27, 1995function outmat = normalize(inmat);[M,N] = size(inmat);aaa = ones(1,N);outmat = inmat.^2;tempmat = sqrt(sum(outmat'));tempmat = tempmat';tempmat = tempmat.^(-1);tempmat = tempmat*aaa;outmat = inmat.*tempmat;

⌨️ 快捷键说明

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