Normalize to unit norm
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a variable containing a probability distribution (just an one-dimensional array of values). How can I normalize a to unit norm?
0 Kommentare
Akzeptierte Antwort
Wayne King
am 27 Mai 2012
If you want to normalize a vector to have unit L2 norm.
x = randn(100,1);
x = x./norm(x,2);
norm(x,2)
12 Kommentare
Oleg Komarov
am 2 Jun. 2012
http://en.wikipedia.org/wiki/Norm_%28mathematics%29, Euclidean vs taxicab
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Random Number Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!