How to generate a fixed number of float numbers and their sum is a fixed float number?

2 ビュー (過去 30 日間)
Suppose I have a fixed float number 0.7,
I want to generate 9 positive float numbers that theri sum is 0.7.

採用された回答

Image Analyst
Image Analyst 2020 年 2 月 16 日
編集済み: Image Analyst 2020 年 2 月 16 日
See this File Exchange submission:

その他の回答 (1 件)

Bhaskar R
Bhaskar R 2020 年 2 月 16 日
This can help you !
res = randfixedsum(9, 1, 0.7, 0,1)

カテゴリ

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