24小时热门版块排行榜    

查看: 389  |  回复: 1

xinji

铜虫 (小有名气)

[求助] Matlab中有没有表示四射五入的函数

Matlab中有没有表示四射五入的函数???
就像Fortran中的nint()函数。
回复此楼
心若在,梦就在!
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xiegangmai

版主 (职业作家)

我没头衔

优秀版主优秀版主优秀版主

【答案】应助回帖

★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
臭水沟: 金币+2, 谢谢交流~~ 2012-05-08 09:31:17
xinji: 金币+5, ★★★很有帮助 2012-05-08 17:16:00
round()函数就可以。

B = floor(A) rounds the elements of A to the nearest integers less than or equal to A. For complex A, the imaginary and real parts are rounded independently.   (floor:朝负无穷方向舍入)

B = ceil(A) rounds the elements of A to the nearest integers greater than or equal to A. For complex A, the imaginary and real parts are rounded independently. (ceil:朝正无穷方向舍入)

B = fix(A) rounds the elements of A toward zero, resulting in an array of integers. For complex A, the imaginary and real parts are rounded independently. (fix:朝零方向舍入 )

B = round(A) rounds the elements of X to the nearest integers. For complex X, the imaginary and real parts are rounded independently. (round:四舍五入)
明德厚学、求是创新
2楼2012-05-07 23:08:50
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 xinji 的主题更新
信息提示
请填处理意见