필터 지우기
필터 지우기

normalize a row vector

조회 수: 1 (최근 30일)
Elysi Cochin
Elysi Cochin 2014년 3월 3일
답변: Giorgos Papakonstantinou 2014년 3월 3일
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....

채택된 답변

Niklas Nylén
Niklas Nylén 2014년 3월 3일

추가 답변 (1개)

Giorgos Papakonstantinou
Giorgos Papakonstantinou 2014년 3월 3일
If I understood correctly:
A=1:128;
B=A/sum(A);
Then:
sum(B)
ans =
1

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by