BInary matrix multiplication
2 ビュー (過去 30 日間)
古いコメントを表示
Hii,
I am trying to multiply two matrices defined as follows:
U = [1 1 1 1 0 0 0 0 0 1 1];
G = [0 1 0 1 1 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 1 0 0 0 0 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0 0 0 0 0
0 1 1 1 0 0 0 1 0 0 0 0 0 0 0
1 0 0 1 0 0 0 0 1 0 0 0 0 0 0
1 0 1 0 0 0 0 0 0 1 0 0 0 0 0
1 0 1 1 0 0 0 0 0 0 1 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 1 0 0 0
1 1 0 1 0 0 0 0 0 0 0 0 1 0 0
1 1 1 0 0 0 0 0 0 0 0 0 0 1 0
1 1 1 1 0 0 0 0 0 0 0 0 0 0 1];
Here U is a matrix of size 1*11 whereas G is a matrix of size 11*15. I have no idea of how to do binary multiplication any suggestions in this regard??
Thanks for you help.
0 件のコメント
回答 (1 件)
Walter Roberson
2012 年 4 月 15 日
You can see binary matrix multiplication code at http://www.mathworks.com/matlabcentral/answers/16192-inversion-of-a-boolean-matrix
7 件のコメント
Onyekachi Ukeje-Eloagu
2016 年 10 月 1 日
I tried using the "mod 2" and "logical" with some problems I am working on. I am not sure what you are referring to when you talk about the boolean addition being defined as an exclusive-or, but the "mod 2" gives the correct answer and "logical" does not
Walter Roberson
2016 年 10 月 1 日
Onyekachi Ukeje-Eloagu: in your situation, should boolean 1+1 be equal to 1 ("or") or should it be equal to 0 ("exclusive or") ?
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!