normalize a row vector
2 次查看(过去 30 天)
显示 更早的评论
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....
0 个评论
采纳的回答
更多回答(1 个)
Giorgos Papakonstantinou
2014-3-3
If I understood correctly:
A=1:128;
B=A/sum(A);
Then:
sum(B)
ans =
1
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!