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

1 次查看(过去 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 CenterFile Exchange 中查找有关 Random Number Generation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by