MATLAB Answers

Detect the error position in a vector and correct it (Matlab)

2 ビュー (過去 30 日間)
Afluo Raoual
Afluo Raoual 2021 年 3 月 18 日
コメント済み: Afluo Raoual 2021 年 3 月 18 日
Dear members;
I have the code word C of length 'M' and I have also the received vector V after decoding of the same length 'M' as C
For example:
V=[1 0 0 1 0 1 0 1 0 0]
C=[1 1 0 1 0 0 0 1 0 0]
I want firstly detecting the position of each bold bit of V and than correct it by adding 1 to those bits (because in mod2: 0+1=1 and 1+1=0) in order to obtain V=C
How can I do that please
  4 件のコメント
Afluo Raoual
Afluo Raoual 2021 年 3 月 18 日
Exactly yes, and then correct the bold bits of V in order to obtain them equal to C

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

採用された回答

Christopher McCausland
Christopher McCausland 2021 年 3 月 18 日
Hi Afluo,
You can try something like the below to assess where the diffrences between the arrays are; after this just cycle to these locations and change the value as you need.
I hope this helps,
Christopher
V=[1 0 0 1 0 1 0 1 0 0]
C=[1 1 0 1 0 0 0 1 0 0]
diff_Check = V ~= C;
  4 件のコメント
Afluo Raoual
Afluo Raoual 2021 年 3 月 18 日
Thank you so much. It works

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by