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

3 vues (au cours des 30 derniers jours)
A = input('Enter matrix for normalization:'); [x,y] = size(A);
z=abs(C); m=0; n=0;
for i=1:x
end
disp(n)

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 11 Sep 2013
Modifié(e) : Azzi Abdelmalek le 11 Sep 2013
A=[2 7;8 10]
out=A/max(abs(A(:)))
  2 commentaires
Sterlin
Sterlin le 12 Sep 2013
Thanks Azzi. That definitely shortened my code and I learned a new command.
Jan
Jan le 12 Sep 2013
But this does not solve the question: "dividing each index by the max abs value in the row".

Connectez-vous pour commenter.

Plus de réponses (1)

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

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by