Generate K random numbers which sum M
Version 1.0.0.0 (2.03 KB) by
Mario CASTRO GAMA
Usually you need to generate K random numbers (uniform distribution) which must add a certain number
The function is able to generate K numbers which add up to M. M can be also a complex number.
Does not accepts constraints in the generation of the numbers. This means the feasibility problem is not addressed.
Cite As
Mario CASTRO GAMA (2025). Generate K random numbers which sum M (https://www.mathworks.com/matlabcentral/fileexchange/45490-generate-k-random-numbers-which-sum-m), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2011a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Random Number Generation in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |