I want to generate a matrix of random numbers between 0 and 2.5 with length=8 and the sum of generated numbers be 20
3 ビュー (過去 30 日間)
古いコメントを表示
I want to generate a matrix of random numbers between 0 and 2.5
The length of generated matrix should be 8 and the total sum of generated matrix should be 20.
need help
thanks in advance
0 件のコメント
採用された回答
the cyclist
2021 年 10 月 22 日
編集済み: the cyclist
2021 年 10 月 22 日
2 件のコメント
the cyclist
2021 年 10 月 22 日
I read your question a bit more closely.
Of course, there is only one way to have 8 numbers that sum to 20, if the max is 2.5, which is to have all the numbers equal 2.5.
So, this function has returned the correct and only answer.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!