How to generate a vector of random numbers whose total must be equal to 1?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I want to generate a random vector. if i add all the values in the generated vector, its sum should be equal to 1.
0 Commenti
Risposte (1)
James Tursa
il 4 Mar 2020
See this FEX submission by Roger Stafford:
4 Commenti
James Tursa
il 4 Mar 2020
... sigh ...
Then transpose the result:
s = randfixedsum(3,1,1,0,1)';
Vedere anche
Categorie
Scopri di più su Random Number Generation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!