writing normally distributed error code

조회 수: 3 (최근 30일)
Lina Alhelo
Lina Alhelo 2019년 6월 2일
편집: Lina Alhelo 2019년 6월 3일
Hello all,
I have an equation
Y = aX + E.....
E is error term that is N ~ ( 0 , [ 25 0 ; 0 25] ) , how I can write a code for E in this case know that it will be 2 x1 matrix size. that is normally distibuted with 0 mean and 25 standard deviation
Thank you in advance.
  댓글 수: 5
Bjorn Gustavsson
Bjorn Gustavsson 2019년 6월 3일
I typically use something like this for scalar white noise with standard deviation proportional to the sqrt(intensity):
I = I_ideal + I_ideal.^.5*randn(size(I_ideal));
Maybe the documentation to normrnd gives you more information?
HTH
Lina Alhelo
Lina Alhelo 2019년 6월 3일
편집: Lina Alhelo 2019년 6월 3일
Thank you very much, your help was valuable.

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

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2019년 6월 2일
Have a look at: randn, and normrnd.
HTH

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by