Can I get randsample() to output zero?
Ältere Kommentare anzeigen
I current have a code like this in MATLAB:
bias = 2; AD = randsample(100,1,1,linspace(1,bias,100));
This makes it 2 times more likely for me to get a value of AD = 100 than to get a value of AD = 1. However, AD can only be between 1 and 10. I want it to be possible that AD = 0, in other words AD be between 0 and 10. How can I do this?
Thank you
2 Kommentare
Adam
am 7 Mär. 2016
Don't you mean AD can be between 1 and 100, but you want it to be between 0 and 100?
Kyle Miller
am 7 Mär. 2016
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Random Number Generation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!