mod
fi
对象的除后模数
说明
示例
两个 fi
对象的模数
计算两个 fi
对象的 mod
。
x = fi(-3,1,7,0); y = fi(2,1,15,0); m1 = mod(x,y) m2 = mod(y,x)
m1 = 1 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 15 FractionLength: 0 m2 = -1 DataTypeMode: Fixed-point: binary point scaling Signedness: Signed WordLength: 15 FractionLength: 0
两个浮点输入的模数
将前面示例中的 fi
输入转换为双精度类型,并计算 mod
。
Mf1 = mod(double(x),double(y)) Mf2 = mod(double(y),double(x))
Mf1 = 1 Mf2 = -1
输入参数
x
— 被除数
标量 | 向量 | 矩阵 | 多维数组
被除数,指定为标量、向量、矩阵或多维数组。x
必须为实数值整数、定点或浮点数组,或实数标量。数值输入 x
和 y
的大小必须相同或兼容。
数据类型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
y
— 除数
标量 | 向量 | 矩阵 | 多维数组
除数,指定为标量、向量、矩阵或多维数组。y
必须为实数值整数、定点或浮点数组,或实数标量。数值输入 x
和 y
的大小必须相同或兼容。
数据类型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| fi
输出参数
m
— 模数运算的结果
标量 | 向量 | 矩阵 | 多维数组
模数运算的结果,以标量、向量、矩阵或多维数组形式返回。
如果输入 x
和 y
均为浮点类型,则 m
的数据类型与这两个输入的数据类型相同。如果输入 x
或 y
为定点类型,则 m
的数据类型为聚合类型 numerictype
。此值等于 fixed.aggregateType(x,y)
的值。
输出 m
始终与默认 fimath
相关联。
算法
fi
对象的 mod(x,y)
使用与内置 MATLAB® mod
函数相同的定义。
版本历史记录
在 R2011b 中推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)