フィルターのクリア

How to add two rows of binary elements of matrix in matlab ?

7 ビュー (過去 30 日間)
Sagar Shriram Salwe
Sagar Shriram Salwe 2018 年 10 月 10 日
コメント済み: Sagar Shriram Salwe 2018 年 10 月 11 日
Hello everyone, I want to add the binary matrix rows with the other. For example[1 0 1;1 1 0] i want to add these row and update in the matrix. Thanking you in advance
  4 件のコメント
Guillaume
Guillaume 2018 年 10 月 10 日
The binary sum of 110b and 010b is 1000b, not 100b, so I don't understand your final H.
Sagar Shriram Salwe
Sagar Shriram Salwe 2018 年 10 月 10 日
編集済み: Sagar Shriram Salwe 2018 年 10 月 10 日
https://en.wikipedia.org/wiki/Low-density_parity-check_code
See in this example H they are adding rowwise and output is just the addition of that number element by element(Actually Avoiding the carry generated).

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

採用された回答

Guillaume
Guillaume 2018 年 10 月 10 日
Ok, you left out a lot of necessary information in your question. In particular, that your addition is performed in the 2 element galois field.
As stated on the wiki page, addition in GF(2) is simply a logical xor, so:
H(1, :) = xor(H(1, :), H(2, :))
Or you could use the features of the Communication System Toolbox (which I don't have) which fully support galois fields computation and has functions for error detection. It may even have your LDPC algorithm already implemented.
  4 件のコメント
Guillaume
Guillaume 2018 年 10 月 11 日
I'm afraid this is way outside my area of expertise. I learned this stuff 20 years ago and haven't used it since then.
Sagar Shriram Salwe
Sagar Shriram Salwe 2018 年 10 月 11 日
Actually while doing manually and adding the same quantities we are getting Null matrix. By multiplying G and Transpose of H and adding the elements by xor resolve this issue. In matlab for to do same any function is available or not?

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

その他の回答 (1 件)

Adam Danz
Adam Danz 2018 年 10 月 10 日
編集済み: Adam Danz 2018 年 10 月 10 日
Use bi2de() to convert the binary vectors to decimal; then add; then convert back to binary vector using de2bi(). These function are from communications toolbox.
H=[1 1 0;0 1 0]
bisum = de2bi(sum(bi2de(H)))
If you'd like to replace the first row of H with the new sum vector,
H(1,:) = de2bi(sum(bi2de(H)))
  3 件のコメント
Adam Danz
Adam Danz 2018 年 10 月 10 日
編集済み: Adam Danz 2018 年 10 月 10 日
Yeah, this answer addresses adding binary matrix rows which was your original question prior to Guillaume looking into what you really wanted to do.
Sagar Shriram Salwe
Sagar Shriram Salwe 2018 年 10 月 10 日
Thank you!!! I Actually formulated as per the wiki page. It should be GF(2) addition i.e. xor operation.

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

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by