永发信息网

matlab中的floor什么意思

答案:1  悬赏:10  手机版
解决时间 2021-04-06 01:38
  • 提问者网友:蓝莓格格巫
  • 2021-04-05 05:38
matlab中的floor什么意思
最佳答案
  • 五星知识达人网友:胯下狙击手
  • 2021-04-05 06:42
a(i)等于x对3取余数,
mod的例子如下:

>> mod(3,3)

ans =

0

>> mod(5,3)

ans =

2

>> mod(1,3)

ans =

1

mod的详细解释如下:
>> help mod
mod Modulus after division.
mod(x,y) is x - n.*y where n = floor(x./y) if y ~= 0. If y is not an
integer and the quotient x./y is within roundoff error of an integer,
then n is that integer. The inputs x and y must be real arrays of the
same size, or real scalars.

The statement "x and y are congruent mod m" means mod(x,m) == mod(y,m).

By convention:
mod(x,0) is x.
mod(x,x) is 0.
mod(x,y), for x~=y and y~=0, has the same sign as y.

Note: REM(x,y), for x~=y and y~=0, has the same sign as x.
mod(x,y) and REM(x,y) are equal if x and y have the same sign, but
differ by y if x and y have different signs.
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯