更新时间:2021-08-03 09:54:38
在MATLAB中,请记住向量化=速度.
Remember, in MATLAB, vectorizing = speed.
如果A
是M x N矩阵,
If A
is an M x N matrix,
A = rand(m,n);
minA = repmat(min(A), [size(A, 1), 1]);
normA = max(A) - min(A); % this is a vector
normA = repmat(normA, [length(normA) 1]); % this makes it a matrix
% of the same size as A
normalizedA = (A - minA)./normA; % your normalized matrix