Add gaussian distributed noise with mean and variance to matrix

조회 수: 45 (최근 30일)
monkey_matlab
monkey_matlab 2015년 11월 5일
댓글: Muhammad Yasir 2021년 7월 14일
Hello,
I've seen that to add gaussian distributed noise to a matrix A with mean 0 and var = 5, this is the code
A_wnoise = A + 5*randn(size(A))
Now, how do you add noise with mean 5 and var = 5 to the matrix A? Thanks.

채택된 답변

Image Analyst
Image Analyst 2015년 11월 5일
A_wnoise = A + 5*randn(size(A)) + 5;
  댓글 수: 4
Deryk Smith
Deryk Smith 2020년 8월 13일
What if your variance is supposed to be (0:0.1:10)? the code does not work then.
Image Analyst
Image Analyst 2020년 8월 14일
Variance can't be an array. However you can put one variance into randn() and put it into a loop over all variances to get a family of arrays.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Muhammad Yasir
Muhammad Yasir 2021년 7월 12일
How can I generate a noise sequence w_t, which is i.i.d. Gaussian of mean zero with variance 2I3 (2xI3 ,where I3 is identity matrix of dimension 3x3) and the initial condition is x_init = [10 10 −10]'
  댓글 수: 6
Image Analyst
Image Analyst 2021년 7월 13일
"OK, I will do that..." <== I just checked and it's not there yet.
Muhammad Yasir
Muhammad Yasir 2021년 7월 14일
Sorry, I could post it immediately. I have posted this question as per your advice. Here is the link to my Query:
https://uk.mathworks.com/matlabcentral/answers/878528-how-to-generate-iid-gaussian-noise-vector

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by