How do I code to normalize a matrix by dividing each index by the max abs value in the row

3 次查看(过去 30 天)
A = input('Enter matrix for normalization:'); [x,y] = size(A);
z=abs(C); m=0; n=0;
for i=1:x
end
disp(n)

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-9-11
编辑:Azzi Abdelmalek 2013-9-11
A=[2 7;8 10]
out=A/max(abs(A(:)))

更多回答(1 个)

Jan
Jan 2013-9-12
A = [2 7;8 10];
m = max(abs(A), [], 2);
B = bsxfun(@rdivide, A, m);

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by