How to make operator for random matrix(matlab command is randn) ? please help me
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
SUMIT
am 4 Mai 2014
Kommentiert: Star Strider
am 4 Mai 2014
How to make operator for random matrix(matlab command is randn) ? please help me
0 Kommentare
Akzeptierte Antwort
Star Strider
am 4 Mai 2014
Bearbeitet: Star Strider
am 4 Mai 2014
If you want to create normally-distributed random variables with a standard deviation of s and a mean of m with randn, this will work:
nrmrnd = @(m,s) m + s*randn;
or if you want a row r by column c matrix of them:
nrmrnd = @(m,s,r,c) m + s*randn(r,c);
4 Kommentare
Star Strider
am 4 Mai 2014
This function should work:
xrndn = @(x) randn(length(x))*x(:);
Call it as:
y = xrndn(x);
for any vector x.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!