hi,,,I am trying to generate a 12 bit data string whose 30% bit will be erased.How can I do that?

1 次查看(过去 30 天)
The data string is A=[ 1 0 0 0 0 0 0 1 1 0 1 0];
I am trying to generate a binary erasure channel.I am replacing the erased bit with number 3.if my erasure probability is 25% (the probability of every bit is erased and replaced by 3 is 25%),then how do I write the code for that? Thanks in advance

采纳的回答

Jan
Jan 2016-6-21
A = [1 0 0 0 0 0 0 1 1 0 1 0];
A(rand(size(A)) <= 0.25) = 3;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by