相关代码 |
|
例1.30 数组的逻辑运算。 >> X=magic(4) X = 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 >> Y=mod(X,3) Y = 1 2 0 1 2 2 1 2 0 1 0 0 1 2 0 1 >> Z1= X&Y Z1 = 1 1 0 1 1 1 1 1 0 1 0 0 1 1 0 1 >> Z2=X|Y Z2 = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 >> X3=~Y X3 = 0 0 1 0 0 0 0 0 1 0 1 1 0 0 1 0