how can i create Bernoulli random variable of a given probability
8 次查看(过去 30 天)
显示 更早的评论
i have avalue of propability but i want to create a bernoulli random variable
P_LOS_1(i)=exp(-d(i)*lambda1);
x(i)=binornd(1,P_LOS_1(i));
P_NLOS1(i)=1-P_LOS1(i);
y(i)=binornd(1,P_NLOS_1(i));
If x(i) is one, y(i) MUST be zero and vice versa
but by this code it not true
i want to know what is error here ??
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!