flxor.m

来自「Proakis《contemporarycommunication system」· M 代码 · 共 20 行

M
20
字号
function z = flxor(x,y)
%FLXOR  Exclusive OR computation.
%       FLXOR(X,Y) returns bit-wise exclusive OR computation
%       between the two integers X and Y.
%
%       See also: GFPLUS.

%       Wes Wang 10/5/95
%       Copyright (c) 1995-96 by The MathWorks, Inc.
%       $Revision: 1.1 $  $Date: 1996/04/01 17:57:42 $

z = 0;
p = 1;
while x ~= 0 | y ~= 0
   z = z + (rem(x,2) ~= rem(y,2))*p;
   p = 2*p;
   x = fix(x/2);
   y = fix(y/2);
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?