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,    -3,    -1,    0,    0,    1,    2,     -2+2i]

ceil(a)= [ 0,     -2,     0,    1,    1,    2,    3,     -1+3i]

fix(a)=  [ 0,     -2,     0,    0,    0,    1,    2,     -1+2i]

round(a)=[-1,     -2,     0,    0,    1,    1,    3,     -1+3i]

注:For complex X, for all the four fuctions the imaginary and real parts are rounded independently.
 

关于Matlab里面的四个取整(舍入)函数:Floor, Ceil, Fix, Round的解释(转)的更多相关文章

  1. Matlab中的取整-floor,ceil,fix,round

    FLOOR Round towards minus infinity. FLOOR(X) rounds the elements of X to the nearest integers toward ...

  2. java的四种取整方法

    java 中取整操作提供了四种方法:分别是: public static double ceil(double a)//向上取整  public static double floor(double ...

  3. js 小数取整的函数

    1.丢弃小数部分,保留整数部分 js:parseInt(7/2) 2.向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 3,四舍五入. js: Math.round(7/2) 4, ...

  4. js 中小数取整的函数

    1.丢弃小数部分,保留整数部分 js:parseInt(7/2) 2.向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 3,四舍五入. js: Math.round(7/2) 4, ...

  5. JS中对小数取整的函数,向上(下),四舍五入取整

    1.丢弃小数部分,保留整数部分 js:parseInt(7/2) 2.向上取整,有小数就整数部分加1 js: Math.ceil(7/2) 3,四舍五入. js: Math.round(7/2) 4, ...

  6. JS对象 向上取整ceil() ceil() 方法可对一个数进行向上取整。 语法: Math.ceil(x) 注意:它返回的是大于或等于x,并且与x最接近的整数。

    向上取整ceil() ceil() 方法可对一个数进行向上取整. 语法: Math.ceil(x) 参数说明: 注意:它返回的是大于或等于x,并且与x最接近的整数. 我们将把 ceil() 方法运用到 ...

  7. C/C++四种取整函数floor,ceil,trunc,round

    处理浮点数操作常用到取整函数,C/C++提供了四种取整函数 floor函数 floor函数:向下取整函数,或称为向负无穷取整 double floor(double x); floor(-5.5) = ...

  8. iOS 常用的向上,向下取整, 四舍五入函数

    向上取整:ceil(x),返回不小于x的最小整数; 向下取整:floor(x),返回不大于x的最大整数; 四舍五入:round(x) 截尾取整函数:trunc(x)  

  9. js只保留整数,向上取整,四舍五入,向下取整等函数

    1.丢弃小数部分,保留整数部分 parseInt(5/2) 2.向上取整,有小数就整数部分加1 Math.ceil(5/2) 3.四舍五入. Math.round(5/2) 4.向下取整 Math.f ...

随机推荐

  1. MySQL 忘记密码怎么办?

    有时候经常忘记密码,或者更改密码时按错键的,或者不知名的错误.下面介绍windows下,解决办法都是差不多: 更改登录权限为全开放,进入后再更改权限更改密码 有几种情况 (1)如果是使用 WampSe ...

  2. ASPxGridView行的选中和行的焦点

    <SettingsBehavior AllowFocusedRow="true" /> 行的焦点,行的点击以及Command列按钮点击可以得到焦点 Styles-Foc ...

  3. ES6新特性:var与let区别

    1.let的用法类似于var,但是所声明的变量,只在let命令所在的代码块内有效.var定义的变量为全局变量. 2.var在同一块可以重复定义,let不能 //正常 function () { var ...

  4. tcpcopy架构

    tcpCopy 1.0 的最新架构分为三个角色: Online Server(OS):上面要部署 TCPCopy,从数据链路层(pcap 接口)抓请求数据包,发包是从IP层发出去: Test Serv ...

  5. 动态We API(ABP官方文档翻译)

    动态Web API层 创建动态Web API控制器 ForAll方法 重写ForAll ForMethods Http动词 WithVerb方法 HTTP特性 命名约定 API管理器 RemoteSe ...

  6. CodeForces765B

    B. Code obfuscation time limit per test:2 seconds memory limit per test:512 megabytes input:standard ...

  7. Python3 笔记01:求两数之和

    这是来自于leetcode的题目: 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的 两个 整数. 你可以假设每种输入只会对应一个答案.但是,你不能重复利用这个数 ...

  8. 初学PS

    PS中的一些快捷键:新建:Ctrl+N 放大:Ctrl++ 缩小:Ctrl+- 首选项:Ctrl+K 标尺:Ctrl+R移动视图:空格键 绘制正圆:Shift 绘制鼠标落脚点为中心的正圆:Shift+ ...

  9. 浏览器根对象document之数值和布尔属性

    1.1 节点类型 ELEMENT_NODE 1 一个 元素 节点,例如 <p> 和 <div>. TEXT_NODE 3 Element 或者 Attr 中实际的文字 PROC ...

  10. 使用Keras进行多GPU训练 multi_gpu_model

    使用Keras训练具有多个GPU的深度神经网络(照片来源:Nor-Tech.com). 摘要 在今天的博客文章中,我们学习了如何使用多个GPU来训练基于Keras的深度神经网络. 使用多个GPU使我们 ...