标签:
matlab取整函数 |
分类: 学术问题 |
floor:朝负无穷方向舍入
B = floor(A) rounds the elements of A to the nearest integers
less than or equal to A.
ceil:朝正无穷方向舍入
B = ceil(A) rounds the elements of A to the nearest integers
greater than or equal to A.
fix:朝零方向舍入
B = fix(A) rounds the elements of A toward zero, resulting in
an array of integers.
round:四舍五入
B = round(A) rounds the elements of X to the
nearest integers.
Example:
a=
[-0.9, -2.1,
-0.4, 0.3,
0.8, 1.1,
2.7, -1.2+2.9i];
floor(a)=[
-1,
ceil(a)=
fix(a)=
round(a)=[-1,
注:For complex X, for all the four fuctions the imaginary and
real parts are rounded independently.
前一篇:?
后一篇:郁闷中,老大说....