필터 지우기
필터 지우기

sum of row equal to particular number.

조회 수: 1 (최근 30일)
parag gupta
parag gupta 2019년 3월 20일
댓글: parag gupta 2019년 3월 20일
I have the following matrix
B = [2 2 2 3; ...
2 2 1 1; ...
4 5 2 1]
How to make sum of all these rows to be 0.0014. I mean sum of 1st row = 0.0014,sum of 2st row = 0.0014 and so on.Which matlab command I should use to transform the above matrix to a matrix with sum of 1st row = 0.0014,sum of 2st row = 0.0014 .
I tried to use randifix command but I dont want sum of coloums to be 0.0014.
Thanks
  댓글 수: 2
Jan
Jan 2019년 3월 20일
I do not know a function called "randifix". So please mention, what you mean.
parag gupta
parag gupta 2019년 3월 20일
sorry ..its " randfixedsum "

댓글을 달려면 로그인하십시오.

채택된 답변

Jan
Jan 2019년 3월 20일
편집: Jan 2019년 3월 20일
B = [2 2 2 3; ...
2 2 1 1; ...
4 5 2 1]
Result = B ./ sum(B, 2) * 0.0014 % Auto-expand: >= R2016b
  댓글 수: 1
parag gupta
parag gupta 2019년 3월 20일
편집: parag gupta 2019년 3월 20일
thank you very much jan !
:)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by