# How to normalize 60x3 vector to zero mean and unit variance

2 visualizaciones (últimos 30 días)
krishnasri el 16 de Jun. de 2015
Comentada: Luis el 15 de Ag. de 2016
I have vector size of 60x3 in an excel sheet, I need to find the zero mean and unit variance of all the values in that sheet and write back the result into another excel sheet. Can u please help me in writing the code.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Walter Roberson el 16 de Jun. de 2015
New_Array = (The_Array - mean(The_Array(:))) . / var(The_Array(:));
This assumes that the array as a whole is to have zero mean and unit variance, rather than each row or column to independently have zero mean and unit variance. If you want the columns done independently:
(The_Array - repmat(mean(The_Array), size(The_Array,1), 1)) ./ repmat(var(The_array), size(The_Array,1), 1);
##### 7 comentariosMostrar 5 comentarios más antiguosOcultar 5 comentarios más antiguos
krishnasri el 17 de Jun. de 2015
Okay got it.. Thanq...
Luis el 15 de Ag. de 2016
Actually you should divide by the standard deviation (std), not the variance (var)
(The_Array - repmat(mean(The_Array), size(The_Array,1), 1)) ./ repmat(std(The_array), size(The_Array,1), 1);

Iniciar sesión para comentar.

### Categorías

Más información sobre Spreadsheets en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by