Normalization of a vector

 Risposta accettata

Stephan
Stephan il 18 Mar 2019
Modificato: Stephan il 18 Mar 2019
result = normalize(v,'range',[-1 1])
where v is your vector

2 Commenti

Guido Pastore
Guido Pastore il 18 Mar 2019
Thank you so much
you may also be interested in:
v = [-2 -1 0; 0.5 1.5 2; 0 2 -1]
result = rescale(v,-1, 1)
which works for arrays. Compare the results of both approaches and choose the option that meets your needs.

Accedi per commentare.

Più risposte (0)

Categorie

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by