How do I code to normalize a matrix by dividing each index by the max abs value in the row
Show older comments
A = input('Enter matrix for normalization:'); [x,y] = size(A);
z=abs(C); m=0; n=0;
for i=1:x
end
disp(n)
Accepted Answer
More Answers (1)
Jan
on 12 Sep 2013
A = [2 7;8 10];
m = max(abs(A), [], 2);
B = bsxfun(@rdivide, A, m);
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!