How do I create a random variable which is exponential with a mean of 2

조회 수: 11 (최근 30일)
Hey, I need to create a signal, X, which is exponential with a mean of 2. It is transmitted through an additive Gaussian noise channel where the Gaussian noise has a mean of -1 and a variance of 4. The signal and noise are independent.
I realize I have to use randn() for the random variable but am not really sure how to get a specific mean or how to produce the Gaussian. Have been away from MatLab for awhile. Any help would be greatly appreciated. Thanks! -Will

채택된 답변

bym
bym 2011년 11월 15일
if you have the statistics toolbox:
exprnd()
to roll your own
x = -2*log(rand)

추가 답변 (1개)

Will
Will 2011년 11월 15일
Thanks didn't even realize I had the stats toolbox. Any ideas on how to produce the additive Gaussian noise channel?
  댓글 수: 3
bym
bym 2011년 11월 15일
whoops should be
agwn = 2*randn(size(A))-1 %multiply by standard deviation *not* variance, sorry

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

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by