How to make operator for random matrix(matlab command is randn) ? please help me
1 次查看(过去 30 天)
显示 更早的评论
How to make operator for random matrix(matlab command is randn) ? please help me
0 个评论
采纳的回答
Star Strider
2014-5-4
编辑:Star Strider
2014-5-4
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 个评论
Star Strider
2014-5-4
This function should work:
xrndn = @(x) randn(length(x))*x(:);
Call it as:
y = xrndn(x);
for any vector x.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!