Borrar filtros
Borrar filtros

normalize a row vector

1 visualización (últimos 30 días)
Elysi Cochin
Elysi Cochin el 3 de Mzo. de 2014
Respondida: Giorgos Papakonstantinou el 3 de Mzo. de 2014
i have a vector of size A = 1*128.... i wanted to normalize the vector to B, such that when i sum the new matrix B, i get its sum of all column values as 1....
is there any method to do it?... please do reply....

Respuesta aceptada

Niklas Nylén
Niklas Nylén el 3 de Mzo. de 2014
B = A./sum(A);

Más respuestas (1)

Giorgos Papakonstantinou
Giorgos Papakonstantinou el 3 de Mzo. de 2014
If I understood correctly:
A=1:128;
B=A/sum(A);
Then:
sum(B)
ans =
1

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by