generating random values with condition
2 次查看(过去 30 天)
显示 更早的评论
Hi all
how to generate 12 random values, each number can be in the range from 0.01 to 1 but the summation of each successive 4 numbers must be equal to 1.
1 个评论
Image Analyst
2020-1-15
This is quirky enough that it sounds very much like homework. And I'm sure that you can't ethically turn in our code as your own, so read this link, and read the documentation on rand(). And realize that you can divide and multiply sets of 4 numbers to get new, scaled numbers.
回答(1 个)
James Tursa
2020-1-15
You could use this FEX submission by Roger Stafford for each 4 number block:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio and Video Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!