Effacer les filtres
Effacer les filtres

How to normalize only one column of a matrix

6 vues (au cours des 30 derniers jours)
Jórdan Venâncio Leite
Jórdan Venâncio Leite le 27 Oct 2021
Modifié(e) : Stephen23 le 27 Oct 2021
Hi,
I need to normalize only one column (column 2 of my array X) of an array with 4 columns by rescaling the range of the data to the interval [0,1]. How to do this? I tried using the function below, but I wasn't successful.
Norm=normalize(X,2,'range');

Réponse acceptée

Stephen23
Stephen23 le 27 Oct 2021
Modifié(e) : Stephen23 le 27 Oct 2021
normalize(X(:,2),'range',[0,1])
or simply
rescale(X(:,2))
If you want to replace the data in the matrix then allocate the function output, i.e.:
X(:,2) = ...

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays 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