MATLAB中怎样进行模二加的运算?

来源:百度知道 编辑:UC知道 时间:2024/05/14 00:09:55
在编码理论的学习中都是二进制呀!想用MATLAB进行模二加的矩阵乘法运算!
是矩阵运算,xor怎么用?

mod(a+b,2), very straight forward.

In most cases, you can prove that the modulo operation can be performed at the last step. Therefore, the function \'mod \' will be much better than \'xor\' in the situation like:

mod(a*b*c*d*e,2), where a,b,c,d,e are all matrices.

换个思路。
模二加其实就是异或运算。所以用xor(A,B)就可以了。

用.*就是矩阵乘法