how to normalize a matrix?????

3 vues (au cours des 30 derniers jours)
abdulkader helwan
abdulkader helwan le 22 Oct 2014
hello everyone... i need a code to normalize( between 0 and 1) a matrix 7*50. the normalization process should be for each column not row**. in other words, the program should seek for the largest value in each column and divide all the elements in that column by it. can anybody help plzz

Réponses (3)

James Tursa
James Tursa le 22 Oct 2014
Modifié(e) : James Tursa le 22 Oct 2014
Assuming values are positive, e.g.,
M = your matrix
N = bsxfun(@rdivide,M,max(M)); % Normalized (scaled) matrix by column
  1 commentaire
MANNY LEN VILLA SUAREZ
MANNY LEN VILLA SUAREZ le 22 Fév 2021
excelent,thank you

Connectez-vous pour commenter.


Greg Heath
Greg Heath le 23 Oct 2014
rng('default')
A = 100*randn(3)
Amin = repmat(min(A),3,1)
Amax = repmat(max(A),3,1)
a = (A-Amin)./(Amax-Amin)
Hope this helps.
Thank you for formally accepting my answer
Greg
  1 commentaire
Image Analyst
Image Analyst le 25 Oct 2014
abdulkader's "Answer" moved here:
thnaks bro.. that was helpful

Connectez-vous pour commenter.


Steven Lord
Steven Lord le 22 Fév 2021
Use the normalize function with a dim input and the 'range' normalization method.

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by