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

3 ビュー (過去 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;
  1 件のコメント
nafila aytija
nafila aytija 2016 年 6 月 21 日
hi,thank you for your answer,But when i am trying to run this code it gives an error message saying"attempt to generate SCRIPT as a FUNCTION"

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall MATLAB from C++ についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by