<P><FONT color=#ff0000>R = rem(X,Y)</FONT> if Y ~= 0, returns X - n.*Y where n = fix(X./Y). If Y is not an integer and the quotient X./Y is within roundoff error of an integer, then n is that integer. By convention, <FONT color=#0000ff>rem(X,0) is NaN</FONT>. The inputs X and Y must be real arrays of the same size, or real scalars<br><br><FONT color=#ff0000>M = mod(X,Y)</FONT> if Y ~= 0, returns X - n.*Y where n = floor(X./Y) . If Y is not an integer and the quotient X./Y is within roundoff error of an integer, then n is that integer. By convention, <FONT color=#0000ff>mod(X,0) is X.</FONT> The inputs X and Y must be real arrays of the same size, or real scalars<br><br><br><FONT color=#ff0000>So long as operands X and Y are of the same sign, the statement rem(X,Y) returns the same result as does mod(X,Y). <br></FONT><FONT color=#0000ff>However, for positive X and Y, rem(-X,Y) = mod(-X,Y)-Y<br>也就是说除了特定的几个用途外,只有正负时候的转化有区别。<br></FONT></P>
<P>The <FONT color=#ff0000>rem</FONT> function returns a result that is between 0 and sign(X)*abs(Y). If Y is zero, rem returns NaN.<br>The <FONT color=#ff0000>mod</FONT> function is useful for congruence relationships: x and y are congruent (mod m) if and only if mod(x,m) == mod(y,m).<br>对于平常用的常数类或者常数矩阵基本没有区别。</P>
[此贴子已经被作者于2006-6-4 17:26:02编辑过]
|