generating a random variable with a given mean and matrix
3 ビュー (過去 30 日間)
古いコメントを表示
can any one tell me how to generate a NORMAL DISTRIBUTION random variable X = N(mu,A), where mu is the mean (mu = 0, 0 mean) and A is a p*p IDENTITY MATRIX. Please ask me if the question is unclear. Thanks
採用された回答
Image Analyst
2016 年 10 月 15 日
Like this?
numRows = size(A, 1);
A(logical(eye(numRows))) = randn(1, numRows)
8 件のコメント
Image Analyst
2016 年 10 月 15 日
I don't believe you can do that and have the random variable be random. If it's random, you won't have A=eye(10) for the covariance matrix.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Random Number Generation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!