Generate random numbers with specific properties
Ältere Kommentare anzeigen
Is anyone aware of something within the Statistics Toolbox (or an FEX submission) that can generate a set of M random numbers where the mean of the random set is X and the mean of the absolute value of the random set is Y.
For example:
M = 21;
X = 0;
Y = 0.5;
A = some_rand_function(M,X,Y)
For example, a non-random version of A that almost matches the specific criteria is:
>> A = -1:0.1:1;
>> mean(A)
ans =
0
>> mean(abs(A))
ans =
0.528
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!