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