How to normalize a column vector in [-1 1]?

1 vue (au cours des 30 derniers jours)
FARHAD
FARHAD le 31 Mai 2014
Modifié(e) : Star Strider le 31 Mai 2014
Hi, I have a column vector and I want to normalize this column in [-1 1]. Could someone write MATLAB code to do it? Thanks in advance.

Réponses (1)

Star Strider
Star Strider le 31 Mai 2014
Modifié(e) : Star Strider le 31 Mai 2014
This works:
v = rand(10,1) % Original vector
vx = v*2/(max(v)-min(v));
vn = vx-(min(vx)+1) % Normalised vector

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by