How to normalize a column vector in [-1 1]?
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
Star Strider
2014-5-31
编辑:Star Strider
2014-5-31
This works:
v = rand(10,1) % Original vector
vx = v*2/(max(v)-min(v));
vn = vx-(min(vx)+1) % Normalised vector
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!