how to do bitxor operation of two 1*255 matrix
3 ビュー (過去 30 日間)
表示 古いコメント
h1 =1x255 logical
h3 = 1x255 logical
howto do bitxor of h1 and h3
0 件のコメント
回答 (2 件)
Greg
2018 年 11 月 30 日
編集済み: Greg
2018 年 11 月 30 日
result = h1 | h3;
Edit: this is logical (bit) or, not xor. As posted elsewhere, simply use the xor function.
4 件のコメント
Greg
2018 年 11 月 30 日
Good catch Guillaume, i kept reading or not xor.
Why are we assuming c is the second argument? The original post explicitly states h1 and h3, both are logical and same size. All following posts are new problems to the original question.
James Tursa
2018 年 11 月 30 日
編集済み: James Tursa
2018 年 11 月 30 日
It's not entirely clear to me what operation you really want, but if the elements of h1 and h2 represent "bits", then you could just do this:
result = (h1 ~= h2); % equivalent of xor between the elements of h1 and h2
If h1 and h2 don't have the same number of elements, then that is a different problem that you will need to fix before doing the xor operation.
2 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!