sum of row equal to particular number.

2 ビュー (過去 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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by